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!

xmlns:xsi namespace in an element

Status
Not open for further replies.

mmarino

Programmer
Mar 22, 2002
42
0
0
US
Hello, I'm new to XSLT transformation, and I can't find an answer to this.
My XLST file contains the following:
Code:
<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]

<xsl:output method="xml" encoding="utf-8" omit-xml-declaration="yes" indent="no" />
<xsl:decimal-format name="europeancommadecimal" decimal-separator=',' grouping-separator='.' />
<xsl:decimal-format name="europeancommaspace" decimal-separator=',' grouping-separator=' ' />

<xsl:template match="/some_data">
<ELEM xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance">[/URL]
<xsl:attribute name="VERSION">1.0</xsl:attribute>
<ITEM>
<xsl:apply-templates select="items"/>
</ITEM>
</ELEM>
</xsl:template>

My result XML should look like this:

<ELEM xmlns:xsi=" VERSION="1.0">
<ITEM></ITEM>
</ELEM>

My problem is that I can't get the xmlns:xsi= part to show up. The XSL looks like this:
<ELEM VERSION="1.0">
<ITEM></ITEM>
</ELEM>

Any help will be appreciated.

Thanks!
 
What xslt processor is it and under what application?
 
I'm building an application in VS2008, but I'm using classic ASP with XML 6.
 
In that case, it may just be an illusion if you view the resultant xml in the browser. The namespace declaration is there. (You are using one of the most compliant parsers out there. I should give credit where credit goes.)

Suppose oxml be the parser holding the transformed document. Serve the response.write oxml.xml with further escaping angle brackets. Figuratively like this.
[tt] response.write replace(replace(oxml.xml,"<","&lt;"),">","&gt;")[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top