我有一个XML文件:
<root>
<Person ID="123">
<Name @name="JohnDoe"/>
<OtherInfo>
......
</OtherInfo>
</Person>
<Person ID="456">
<Name @name="JaneDoe"/>
<OtherInfo>
......
</OtherInfo>
</Person>
<Person ID="789">
<Name @name="JohnDoe"/>
<OtherInfo>
......
</OtherInfo>
</Person>
</root>
我想要一个XSLT文件输出两个文件:
文件1:
<root>
<Person ID="123">
<OtherInfo>
......
</OtherInfo>
</Person>
<Person ID="456">
<OtherInfo>
......
</OtherInfo>
</Person>
<Person ID="789">
<OtherInfo>
......
</OtherInfo>
</Person>
</root>
文件2: JohnDoe,JaneDoe,JohnDoe
我希望能够一次通过原始XML文件来执行此操作。
答案 0 :(得分:1)
使用xsl:result-document
指令在XSLT 2.0中很容易做到。
除非您的1.0处理器具有与xsl:result-document
等效的专有扩展名,否则在XSLT 1.0中是不可能的。