下面是我的输入 XML
<First>
<practice-session note="yes">
<lessons>13000</lessons>
<lessons>15000</lessons>
<lessons>note</lessons>
</practice-session>
<practice-repeats note="yes">>
<repeat>20000</repeat>
<repeat>15000</repeat>
<repeat>description</repeat>
</practice-repeats>
</First>
上面的输出是
<chapters>
<chapter>
<practice-session>
<value>13000</value>
</practice-session>
<practice-repeats>
<value>20000</value>
</practice-repeats>
</chapter>
<chapter>
<practice-session>
<lesson>15000</lesson>
</practice-session>
<practice-repeats>
<lesson>20000</lesson>
</practice-repeats>
</chapter>
<chapter>
<practice-session>
<lesson>NOTE CHG</lesson>
</practice-session>
<practice-repeats>
<lesson>ENG CHG</lesson>
</practice-repeats>
</chapter>
</chapters>
当我在做谷歌和堆栈溢出时,人们建议使用 xsl:copy-of,但是当我使用 xsl:copy 时,我将如何照顾每个练习会话将有练习重复。
有人能帮我一下吗。
提前致谢
问候卡西克