Altova Mailing List Archives
>xsl-list Archive Home
>Thread Prev -
>Thread Next - Re: [xsl] Why does using the XSL namespace default namespace preclude literal result elements in the empty namespace?
[xsl] Why does using the XSL namespace default namespace preclude literal result elements in the empty namespace?
Date: 7/20/2001 11:52:00 PM
I know that's a long subjetct but the instructions said to be specific... I've got a stylesheet with 80-90% of elements in the xsl namespace, the rest being literal result elements destined for html output. All those xsl: prefixes add up to a lotta noise, and well, i can't help but feel there should be a way to avoid it. If what i gather from the 1.0 spec is correct, then these elements can't simply be in an html: namespace (html 4.0 or xhtml, say). I know I can replace them with <element> and <attribute> tags, but, again, that's a lot of noise and you end up putting in c-like terminator comments, e.g. </element><!-- table -->. At first I read the namespace-alias entry and I said "Ooh, there we go!", but no, since you can't have empty namespaces other than the default, there's no way to set the result namespace to the null namespace. So, after all that here's my question: why can't i say <namespace-alias stylesheet-prefix="html" result-prefix="#none"/>? (or #empty or #null, etc) I don't get it, did somebody forget that part of the spec? Or is there some other trick that i'm not aware of? Vender-specific extensions? I looked briefly at the 1.1 working draft and the 2.0 requirements, and didn't see any provisions for this. Am I missing something? Thanks in advance for any info, aaron PS, relevent portions of specs below PPS, I apologize if i'm asking a question answered in the archives or FAQ. I did consult those sources, and came up empty. http://www.w3.org/TR/1999/REC-xslt-19991116.html#section-HTML-Output-Method The |html| output method should not output an element differently from the |xml| output method unless the expanded-name of the element has a null namespace URI; an element whose expanded-name has a non-null namespace URI should be output as XML. http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-decl [Definition:] If the attribute name matches | PrefixedAttName <http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-PrefixedAttName> |, then the | NCName <http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName> | gives the *namespace prefix*, used to associate element and attribute names with the namespace name <http://www.w3.org/TR/1999/REC-xml-names-19990114/#dt-NSName> in the attribute value in the scope of the element to which the declaration is attached. In such declarations, the namespace name may not be empty. [Definition:] If the attribute name matches | DefaultAttName <http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-DefaultAttName> |, then the namespace name <http://www.w3.org/TR/1999/REC-xml-names-19990114/#dt-NSName> in the attribute value is that of the *default namespace* in the scope of the element to which the declaration is attached. In such a default declaration, the attribute value may be empty. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list