I am testing XML.XInclude following its structure guide:

http://www.w3.org/2001/XInclude.xsd

I have a child1.xml file:

<?xml version="1.0"?>
<child1>
  <config>
  </config>
</child1>

a child2.xml file:

<?xml version="1.0"?>
<child2>
  <config>
  </config>
</child2>

and parent.xml file:

<?xml version="1.0"?>
<config xmlns:xi="http://www.w3.org/2001/XInclude">
    <xi:include parse="xml" href="child1.xml"/>
    <xi:include parse="xml" href="child2.xml"/>
</config>

However, when I open parent.xml in Internet Explorer, the child1.xml and child2.xml are not merged inside the parent.xml. I expect that the contents of child1.xml and child2.xml are shown in parent.xml but it does not. I just see this with parent.xml:

<?xml version="1.0" ?> 
- <config xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include parse="xml" href="child1.xml" /> 
  <xi:include parse="xml" href="child2.xml" /> 
  </config>

Did I do something wrong or using XInclude will not show the include files?

Thanks in advance.

有帮助吗?

解决方案

Internet Explorer doesn't have any support for XInclude. Nor does any other browser I can think of. You need to use an XInclude processor. E.g. if you had it parent.xml loaded into a PHP DOMDocument then you could call its xinclude() method and it would process the includes.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top