入力:
<book>
<chapter href="..">
<topicref chunk="to-content" href"..">
</topicref>
<topicref chunk="to-content" href"..">
</topicref>
</chapter>
</book>
出力:
<book>
<chapter chunk="to-content" href="..">
<topicref href"..">
</topicref>
<topicref href"..">
</topicref>
</chapter>
</book>
xsl:attribute name="chunk">to-content</xsl:attribute>
「前の手順で子を作成すると、ここに属性を作成すると失敗します」とスローされるため、使用できません。警告とその後のエラー。ここに記載されていることを理解しています。回避策はありますか?
XSLT 2.0 を Saxon 9 で使用しています (まだ XSLT/ SO のコツをつかんでいます)。これが広すぎる場合は申し訳ありませんが、あらゆる方向の助けをいただければ幸いです。