それが可能かどうかはわかりませんが、ここにあります。
この XML から:
<?xml version="1.0" encoding="UTF-8"?>
<AttributesCollection>
<Attributes>
<AttributeName>AAA</AttributeName>
<AttributeValue>Value1</AttributeValue>
</Attributes>
<Attributes>
<AttributeName>BBB</AttributeName>
<AttributeValue>Value2</AttributeValue>
</Attributes>
</AttributesCollection>
XSL変換を使用して次のように変換しようとしています:
<Attributes>
<AAA>Value1</AAA>
<BBB>Value2</BBB>
</Attributes>
属性名は取得できますが、XML の作成方法がわかりません。これが私が試したものです。
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="./AttributesCollection/Attributes/AttributeName">
Name:<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
私に与える:
<?xml version="1.0" encoding="UTF-8"?>
Name:AAA
Name:BBB
それで、私が探していることをすることは可能ですか?何か助けはありますか?ありがとう