この構造を変換する必要があります
<A>
<B>value1</B>
</A>
<A>
<B>value2</B>
</A>
の中へ
<A>
<B>value1<B>
<B>value2<B>
</A>
XSLT-1.0を使用する最良の解決策は何ですか?ありがとうございました!
PS:私はこのコードを試しました:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
<xsl:key name="group_a" match="//A" use="B"/>
<xsl:template match="/Test"> <a-node> <xsl:for-each select="//A"> <b-node>
<xsl:value-of select="//A/B"/> </b-node> </xsl:for-each> </a-node>
</xsl:template>
</xsl:stylesheet>
ただし、最初の値のみを返します。
<?xml version="1.0" encoding="utf-8"?> <a-node mlns:fo="http://www.w3.org/1999/XSL/Format"> <b-node>value1</b-node> <b-node>value1</b-node> </a-node>
しかし、私は必要です:
<?xml version="1.0" encoding="utf-8"?> <a-node xmlns:fo="http://www.w3.org/1999/XSL/Format"> <b-node>value1</b-node> <b-node>value2</b-node> </a-node>