Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

generate a namespace

Status
Not open for further replies.

Cruisy

Programmer
Oct 11, 2002
8
0
0
BE
I'm trying to generate a namespace in the output xml that is different to the one i use in the xsl

example:
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot; xmlns:xsd=&quot; <xsl:eek:utput method=&quot;xml&quot; version=&quot;1.0&quot; indent=&quot;yes&quot;/>
<xsl:template match=&quot;/&quot;>
<xsl:element name=&quot;xsd:schema&quot;>
<xsl:attribute name=&quot;xmlns&quot;> </xsl:attribute>
...
</xsl:element>
</xsl:template>
</xsl:stylesheet>

so this should get the following output:

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<xsd:schema xmlns:eek:d=&quot;urn:schemas-microsoft-com:eek:fficedata&quot; xmlns:xsd=&quot;...
</xsd:schema>

note that the xsd namespace is the one for 2000 and not the one for 1999. this works fine in eXcelon Stylus Studio.

but when i try to parse it with a Xalan parser it gives the following error/warning:

&quot;SystemId Unknown; Line 12; Column -1; Could not resolve namespace prefix: xmlns. The node will be ignored.&quot;

where the line 12 points to the line where i specified the namespace :
<xsl:attribute name=&quot;xmlns&quot;> </xsl:attribute>
 
xml file

<root xmlns:d=&quot; <d:grid size=&quot;5&quot;>
<d:data url=&quot;pubs&quot; user=&quot;sa&quot; password=&quot;&quot;/>
</d:grid>
</root>

<xsl:stylesheet xmlns:xsl=&quot; xmlns:d=&quot; version=&quot;1.0&quot;>
<xsl:template match=&quot;/&quot;>
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>



Build web applications faster with a few lines of XML Code using DataML[tm]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top