0
如何複製xml文檔跳過一些頂級節點。例如:用xslt複製xml跳過頂級節點
輸入:
<root>
<subroot>
<nodeX id="1">
<!-- inner structure -->
</nodeX>
<nodeX id="2">
<!-- inner structure -->
</nodeX>
<!-- other nodes -->
</subroot>
<root>
輸出:
<nodeX id="1">
<!-- inner structure -->
</nodeX>
<nodeX id="2">
<!-- inner structure -->
</nodeX>
是否有可能跳過另一個節點是根節點的子節點?這些節點匹配/ root/subrootX |/root/subrootY但我不想複製它們。 – Max 2012-03-28 09:54:30
只需將不想複製的圖案添加到第二個模板匹配圖案,例如' xsl:template>'。或者,如果您知道您不想複製任何根元素的任何子元素,請使用已發佈的通用'match =「/ * |/*/*」'。 –
2012-03-28 10:04:11