Subject: Re: [xsl] XMLNS problem From: Michael Kay <mike@xxxxxxxxxxxx> Date: Tue, 12 Feb 2013 21:54:18 +0000 |
The xsl:element instruction creates the ead element in no-namespace, and you then attempt to add a namespace node that binds the default namespace to "urn:isbn:1-.....". Adding a namespace node to an existing element can't change the name(space) of the element, and is an error if it's inconsistent with the name of the element. You need to create the element in the right namespace to start with, and then the namespace node will be created for you automatically:
This is close, but it doesn't include the xmlns line, which appears to be needed for it to validate correctly. The XSLT I have below seems like it should do what I want, but it produces an error in the xsl:namespace declaration.
<xsl:template match="ead"> <xsl:element name="ead"> <xsl:namespace name="">urn:isbn:1-931666-22-9</xsl:namespace> <xsl:attribute name="xsi:schemaLocation">urn:isbn:1-931666-22-9 http://www.loc.gov/ead/ead.xsd</xsl:attribute> <xsl:apply-templates/> </xsl:element> </xsl:template> ... </xsl:stylesheet>
Michael Kay Saxonica
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XMLNS problem, G. Ken Holman | Thread | Re: [xsl] XMLNS problem, Wendell Piez |
Re: [xsl] XMLNS problem, G. Ken Holman | Date | Re: [xsl] XMLNS problem, Wendell Piez |
Month |