8,906
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<Root>
<Node attr1="1: this is attr1" attr2="1: this is attr2" />
<Node attr1="2: this is attr1" attr2="2: this is attr2" />
</Root>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" indent="yes" />
<xsl:template match="/Root">
<Root>
<xsl:for-each select="Node/@*">
<field>
<xsl:attribute name="{name()}">
<xsl:value-of select="." />
</xsl:attribute>
</field>
</xsl:for-each>
</Root>
</xsl:template>
</xsl:stylesheet>