Re: [xml] Identifying the source file for an xi inclusion



On Thu, Jan 29, 2009 at 01:50:52PM -0800, Marc Munro wrote:
I am processing a document which contains nested inclusions using
xi:include.  How can I tell the source file from which a given node was
included into the document?

  Not always possible, for example if you XInclude a text node, well
there is little to help. But you can use 2 things:
  xml:base attribute left by the xinclude process, if you ask for the
    base at a given included point, you may get the proper URI
    if there was room left to put the base attribute at the inclusion
    point (i.e. on an element)
  the XInclude process also turns the original xi:include element into
    an XML_XINCLUDE_START node with all attributes left and also add
    an XML_XINCLUDE_END after the included element(s)

 use xmllint --xinclude --debug to see the associated structures in the
document result.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]