【发布时间】:2013-05-07 21:10:47
【问题描述】:
我想编写一个 xslt 来转换以下 XML:
<instruments>
<instrument>1111-A01</instrument>
<instrument>1111-A02</instrument>
<instrument>2222-A03</instrument>
<instrument>2222-A04</instrument>
</instruments>
到以下 XML:
<references>
<reference>
<id_celex>1111</id_celex>
<article>A01</article>
<article>A02</article>
</reference>
<reference>
<id_celex>2222</id_celex>
<article>A03</article>
<article>A04</article>
</reference>
</references>
所以我需要在“-”处拆分每个乐器,以获得 id_celex 和 article。 然后,对于每个唯一的 id_celex,我需要使用 id_celex 及其 article 来创建引用。
我昨天开始使用 xslt,但我已经卡住了:p
提前谢谢你!
我有几行,但由于它不起作用,我不确定显示它是否有用......
【问题讨论】:
-
如果您的 XSLT 包含 xsl:for-each-group 指令,那么是的,显示它会很有用!