R
Rolf Kemper
Dear All,
I need some help on an XLST. I need to create an XML output from some
xml document by XSLT. The top element must contain multiple name
spaces.
I tried this as an example:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
<xsl:template match="/">
<xsl:element name="E1" namespace="urn:ns1name">
<xsl:attribute name="ns2name"
namespace="xmlns">urn:ns2</xsl:attribute>
<xsl:attribute name="ns3name"
namespace="xmlns">urn:ns3</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
The output (created by ALTOVA XMLSPY with MSXML 4 ) looks like this
<?xml version="1.0" encoding="UTF-8"?>
<E1 auto-ns1:ns2name="urn:ns2" auto-ns1:ns3name="urn:ns3"
xmlns:auto-ns1="xmlns" xmlns="urn:ns1name" />
I expected this:
<?xml version="1.0" encoding="UTF-8"?>
<E1 xmlns="urn:ns1" xmlns:ns2name="urn:ns2" xmlns:ns3name="urn:ns3"/>
Is the output I got equivalent to what I expected ??
How can I achieve the expected output ??
Thanks a lot for your help
Rolf
I need some help on an XLST. I need to create an XML output from some
xml document by XSLT. The top element must contain multiple name
spaces.
I tried this as an example:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
<xsl:template match="/">
<xsl:element name="E1" namespace="urn:ns1name">
<xsl:attribute name="ns2name"
namespace="xmlns">urn:ns2</xsl:attribute>
<xsl:attribute name="ns3name"
namespace="xmlns">urn:ns3</xsl:attribute>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
The output (created by ALTOVA XMLSPY with MSXML 4 ) looks like this
<?xml version="1.0" encoding="UTF-8"?>
<E1 auto-ns1:ns2name="urn:ns2" auto-ns1:ns3name="urn:ns3"
xmlns:auto-ns1="xmlns" xmlns="urn:ns1name" />
I expected this:
<?xml version="1.0" encoding="UTF-8"?>
<E1 xmlns="urn:ns1" xmlns:ns2name="urn:ns2" xmlns:ns3name="urn:ns3"/>
Is the output I got equivalent to what I expected ??
How can I achieve the expected output ??
Thanks a lot for your help
Rolf