Hey
Im really new to XML and cant find a way how to not have xmlns as an attribute en every element.
The xslt code is:
<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" />
<xsl:template match="/">
<xsl:element name ="ConfigData " namespace="http ://www.w3.org/2001/XMLSchema-instance">
<xsl:element name ="VariableSecti on">
<xsl:text>
 
</xsl:text>
<xsl:for-each select="ConfigD ata/VariableSection/Variable">
<xsl:element name="xs:enumer ation">
<xsl:attribut e name="value">
<xsl:value-of select="Softwar eName"></xsl:value-of>
</xsl:attribute>
</xsl:element>
<xsl:text>
 </xsl:text>
</xsl:for-each>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-------- And the output is -----
<?xml version="1.0" encoding="utf-8"?><ConfigD ata xmlns="http://www.w3.org/2001/XMLSchema-instance"><Vari ableSection xmlns="">
<xs:enumerati on value="VA_Reset WTCCommand_Repl y" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" />
<xs:enumerati on value="VA_Reset WTCCommand_Repl y" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" />
<xs:enumerati on value="VA_Reset WTCCommand_Stat us" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" />
<xs:enumerati on value="VA_GetEv entCommand_Requ est" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" />
------------
How can i remove the xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" from every line so it i general?
/Lasse
Im really new to XML and cant find a way how to not have xmlns as an attribute en every element.
The xslt code is:
<xsl:styleshe et xmlns:xsl="http ://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" />
<xsl:template match="/">
<xsl:element name ="ConfigData " namespace="http ://www.w3.org/2001/XMLSchema-instance">
<xsl:element name ="VariableSecti on">
<xsl:text>
 
</xsl:text>
<xsl:for-each select="ConfigD ata/VariableSection/Variable">
<xsl:element name="xs:enumer ation">
<xsl:attribut e name="value">
<xsl:value-of select="Softwar eName"></xsl:value-of>
</xsl:attribute>
</xsl:element>
<xsl:text>
 </xsl:text>
</xsl:for-each>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-------- And the output is -----
<?xml version="1.0" encoding="utf-8"?><ConfigD ata xmlns="http://www.w3.org/2001/XMLSchema-instance"><Vari ableSection xmlns="">
<xs:enumerati on value="VA_Reset WTCCommand_Repl y" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" />
<xs:enumerati on value="VA_Reset WTCCommand_Repl y" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" />
<xs:enumerati on value="VA_Reset WTCCommand_Stat us" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" />
<xs:enumerati on value="VA_GetEv entCommand_Requ est" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" />
------------
How can i remove the xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" from every line so it i general?
/Lasse
Comment