In Saxon you have to change the output method to "html".
Example:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<values>
<field name="abc"></field>
<field name="nch"></field>
</values>
</xsl:template>
</xsl:stylesheet>
HereĀ“s a workearound that works for vs2010.
Example 1:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<values>
<field name="abc">
<xsl:value-of select="substring-before(' ',' ')"/>
</field>
<field name="nch">
<xsl:value-of select="substring-before(' ',' ')"/>
</field>
</values>
</xsl:template>
</xsl:stylesheet>
Example 2:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:element name="values">
<xsl:element name="filed">
<xsl:attribute name="name">abc</xsl:attribute>
<xsl:value-of select="substring-before(' ',' ')"/>
</xsl:element>
<xsl:element name="filed">
<xsl:attribute name="name">nch</xsl:attribute>
<xsl:value-of select="substring-before(' ',' ')"/>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Output:
<?xml version="1.0" encoding="utf-8"?>
<values>
<filed name="abc"></filed>
<filed name="nch"></filed>
</values>