>> English << | По-русскиZVON > Tutorials > XInclude Tutorial
>> Example 12 << | Prev | Next | Contents

Including only a part of the file (parse = xml)


Description

There will be no recursion - we just fetch the element /b/p[1] from file b.xml.

Valid example

The file a.xml includes only the "p" element from file b.xml and thus there will be no errors.
File a.xml:
    <a> 
     <xi:include href="b.xml"
                 xpointer="element(/b/p[1])"
                 parse="xml"
      xmlns:xi="http://www.w3.org/2001/XInclude"/>
    </a>
   

File b.xml:
    <b>
     <p id="p1">aaaa</p>
      <xi:include href="a.xml" parse="xml"
      xmlns:xi="http://www.w3.org/2001/XInclude"/>
    </b>
   

File a.xml after processing:
    <a>
     <p id="p1">aaaa</p>
    </a>