0

反復する構造を作成したいのですが、その内容は既存のノードでなければなりません。このような:

<xsl:variable name='my_structure'>
    <rows-to-add>
      <row>existing-node-with-a-specific-path</row>
      <row>existing-node-with-a-specific-path</row>
    </rows-to-add>
    <rows-to-add>
      <row>existing-node-with-a-specific-path</row>
      <row>existing-node-with-a-specific-path</row>
      <row>existing-node-with-a-specific-path</row>
    </rows-to-add>
</xsl:variable>

そのため、$my_structre を反復処理して、いくつかのロジックを適用できます。

それは可能ですか?

4

1 に答える 1

0

<xsl:copy-of select="existing-node-with-a-specific-path"/>ノードを変数にコピーするために使用します。

頭に浮かぶことの 1 つは、既存のデータで相対 URI アドレスを使用することです。上記を実行したらxml:base-uri="{base-uri(.)}"、変数に追加しました。これがないと、相対 URI の解決がデータではなくスタイルシートに関連するためです。

于 2013-09-27T16:20:47.480 に答える