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



Johann,

sorry, when replying, I overlooked that your original post was to the
libxml2 list.  Seeing LibXML in your text I thought you were talking
about XML::LibXML, a Perl wrapper of libxml2. My reply may therefore
be misleading.

-- Petr

"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
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml


-- 



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