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

Re: [xml] Information about "xincluded" documents in XML tree?



"Johann Richard" <Johann richard dspfactory ch> writes:

> Hi,
>
> I am thinking of using postvalidation on a document that has XIncludes, and it would be way cool if I could get a clue if a validation error occured inside an XIncluded document or not.
>
> I browsed the LibXML code for this, as well as the list archives, but could not really find a clue (which is my fault, maybe? :)). 
>
> When I do an XInclude processing of my XML document, as xmllint w/ --xinclude does, will LibXML store any information in the node tree on xincludes? Say, like, 
>
>   "here, the nodes included from <yourincluded.xml#xpointer(bla)> start"
>      ... [lots of XML :)]
>   "here, the nodes included from <yourincluded.xml#xpointer(bla)> stop"
>
> I saw there was the XML_XINCLUDE_START/STOP defines but I don't quite understand how they work.
>
> Any hint will be much appreciated. Thanks for the good work!

There are special nodes 

  $node->nodeType == XML_XINCLUDE_START and
  $node->nodeType == XML_XINCLUDE_END 

stored in the resulting DOM tree at the boundaries of of an xincluded
part of a document. You may use $node->attributes or maybe
$node->getAttribute methods on an XML_XINCLUDE_START node to query the
href, parse, and encoding attributes of the original <xi:xinclude/>
element.

-- Petr



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