. , . , "". ( "" , . , .)
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="/">
<records>
<xsl:apply-templates select="/recordset/field[1]/*"/>
</records>
</xsl:template>
<xsl:template match="field/*">
<item_line>
<xsl:apply-templates select="/recordset/field">
<xsl:with-param name="pos" select="position()"/>
</xsl:apply-templates>
</item_line>
</xsl:template>
<xsl:template match="field">
<xsl:param name="pos"/>
<xsl:element name="{translate(
@name,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz'
)}">
<xsl:value-of select="*[$pos]"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Let me know if you have any questions.
EDIT: simplified version:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="/">
<records>
<xsl:for-each select="/recordset/field[1]/*">
<xsl:variable name="pos" select="position()" />
<item_line>
<xsl:apply-templates select="/recordset/field/*[$pos]" />
</item_line>
</xsl:for-each>
</records>
</xsl:template>
<xsl:template match="field/*">
<xsl:element name="{translate(
../@name,
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz'
)}">
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
source
share