我今天再次偶然发现一个问题。我有 1000 个名为 book 的标签的 xml。每个标签都有自己的属性,但有些属性是重复的。
所以我有 XML:
... some other not duplicated attribute data ...
<book attribute="attr1"></book>
<book attribute="attr1"></book>
<book attribute="attr1"></book>
... some other not duplicated attribute data ...
<book attribute="attr2"></book>
<book attribute="attr2"></book>
<book attribute="attr2"></book>
... some other not duplicated attribute data ...
有没有办法使用 xslt,所以我可以多次重命名 xml 中的属性:
... some other not duplicated attribute data...
<book attribute="attr1-1"></book>
<book attribute="attr1-2"></book>
<book attribute="attr1-3"></book>
... some other not duplicated attribute data ...
<book attribute="attr2-1"></book>
<book attribute="attr2-2"></book>
<book attribute="attr2-3"></book>
... some other not duplicated attribute data ...
希望 xslt 可以做到这一点,并且没有重复的属性保持不变?非常感谢所有的答案,eoglasi