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

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


Description

We can also include only a fragment of the file, using XPointer.

Valid example

The file a.xml includes a paragraph with attribute id = 'p1' (attribute id is of an ID-type) from file b.xml.
File a.xml:
    <a> 
     <xi:include href="b.xml"
                 xpointer="p1" 
                 parse="xml"
      xmlns:xi="http://www.w3.org/2001/XInclude"/>
    </a>
   

File b.xml:
    <b>
     <p id="p1">aaaa</p>
     <p id="p2">bbbb</p>
    </b>
   

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