这与我之前的问题有关,但我无法为此获得解决方案。在这里,我还需要根据属性值比较两个节点,但这对我来说很难。请提供 xsl 来执行此操作。提前致谢。
输入.xml:
<comp>
<alink>
<link id="#c1-0003"/>
<link id="#c1-0001"/>
<link id="#c1-0002"/>
</alink>
<bibsection>
<bib id="c1-0001">
<citation>
<Name>Boud</Name> (<year>2007</year>)
<vol>32</vol> (<issue>3</issue>
</citation>
</bib>
<bib id="c1-0002">
<citation>
<Name>john</Name>(<year>2008</year>)
<vol>32</vol> (<issue>3</issue>)
</citation>
</bib>
<bib id="c1-0003">
<citation>
<name>nnc</name>(<year>2009</year>)
<vol>32</vol> (<issue>3</issue>)
</citation>
</bib>
</bibsection>
</comp>
输出.xml:
<comp>
<alink>
<link id="#c1-0003"/>
<year>2009</year>
<link id="#c1-0001"/>
<year>2007</year>
<link id="#c1-0002"/>
<year>2008</year>
</alink>
<bibsection>
<bib id="c1-0001">
<citation>
<Name>Boud</Name> (<year>2007</year>)
<vol>32</vol> (<issue>3</issue>
</citation>
</bib>
<bib id="c1-0002">
<citation>
<Name>john</Name>(<year>2008</year>)
<vol>32</vol> (<issue>3</issue>)
</citation>
</bib>
<bib id="c1-0003">
<citation>
<name>nnc</name>(<year>2009</year>)
<vol>32</vol> (<issue>3</issue>)
</citation>
</bib>
</bibsection>