xsl-list
[Top] [All Lists]

Re: Trouble with namespaces and running identity transform on XHTML

2004-03-10 15:22:35

--- Kevin Jones <kjones(_at_)sarvega(_dot_)com> wrote:

Having an explicitly declared namespace attribute
in
xsl:element works in xsltproc, Saxon, and Xalan,
but
not Sablotron, which outputs

<ns_1:html
xmlns:ns_1="http://www.w3.org/1999/xhtml";>
<ns_2:head
xmlns:ns_2="http://www.w3.org/1999/xhtml";>
--snip--
</ns_2:head>
</ns_1:html>


On Sablotron you can get better output by including
a prefix in 
the xsl:element name attribute. Like this,

<xsl:element name="{concat('h:',local-name())}"
      namespace="http://www.w3.org/1999/xhtml";>
      <xsl:apply-templates select="@*|node()" />
</xsl:element>

except in the output, that prefixes elements with
"h:", which I do *not* want.

Anyway, what I'm not sure of is whether the XSLT spec
guarantees that

<xsl:element name="NCName"> <!-- No prefix in NCName
-->
 <!-- Content of NCName . . . -->
</xsl:element>

will result in an element with the unprefixed name
NCName in the default namespace, or if it's just that
XSLT processors happen to serialize that as "<NCName>
. . . </NCName>".


__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you?re looking for faster
http://search.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list