0
我有3个XML文件加载XML子元素:如何从另一个XML文件
的main.xml:
<page>
<title>main page</title>
<elements></elements>
<templates></templates>
</page>
elements.xml中:
<elements>
<element_1>element 1</element_1>
<element_2>element 2</element_2>
</elements>
templates.xml:
<templates>
<template_1>template 1</template_1>
<template_2>template 2</template_2>
</templates>
是否可以加载m ain.xml并查看main.xml中<elements></elements>
节点内的elements.xml的所有<elements>
以及main.xml的<templates></templates>
节点内的templates.xml的所有<templates>
?
所以,main.xml中会像这样的输出:
<page>
<title>main page</title>
<elements>
<element_1>element 1</element_1>
<element_2>element 2</element_2>
</elements>
<templates>
<template_1>template 1</template_1>
<template_2>template 2</template_2>
</templates>
</page>
我应该使用一个XSL文件?你能否给我举一个它如何工作的例子?
我喜欢避免使用服务器端语言,但如果这是严格的秘密,我将使用PHP。
谢谢罗伯特。我用'document()'去了,它就像一个魅力。再次感谢。 – Tony 2011-04-26 19:09:28