Re: [xml] XML_XINCLUDE_START/END nodes



On Wed, Jan 07, 2004 at 12:36:59PM +1100, Malcolm Tredinnick wrote:
On Wed, 2004-01-07 at 12:05, Rob Richards wrote:
What is the purpose of these nodes other than to marking the beginning
and end of xincluded documents?
 
I have a dom implementation which after passing the document through
an xinclude process, contains these nodes. Looking through the dom and
xinclude specs, I couldnt find any reference to these nodes, so can
these just be removed from the tree after the xinclude processing or
do they provide some additional functionality which would need to be
handled in the dom implementation?

After you have created your tree and done any validation you require,
you can ignore those nodes.

It would be inconvenient to automatically drop them from any created
tree, since I have more than once come across situations that need to
know when they are leaving the main document and entering some XIncluded
content.

  Well ... on the other hand that's the only way to know that a document
is the result of some XInclude processing and keep track of the fragments.
Simply xmlUnlinkNode/xmlFreeNode them if you don't need them.
  Now if they ended up being processed as normal node, that mean that
there is a tree traversal algorithm broken somewhere...

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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