Re: [gdome]DTD loading



On Fri, Aug 30, 2002 at 01:39:19PM +0200, Luca Padovani wrote:
> On Fri, 2002-08-30 at 12:50, Christopher Gutteridge wrote:
> > OK. I've written my first C/DOM program and I still get the problem. It's
> > allegedly an Exception 0 (zero) which was not very helpful.
> > 
> > I attach the program. Hopefully it's not something weird and local to my
> > machine or other horrors.
> 
> well, I found the reason. libxml2 does not clone document fragment
> nodes, it just returns NULL. I had a quick look at the DOM
> specification, it says that cloning a Document is implementation
> dependent, but it says nothing about DocumentFragment, so I assume it is
> legal to clone it. Maybe Daniel can give us some more details. I would
> imagine it is quite easy to clone a DocumentFragment as well, I don't
> think it poses any new problems.

  Hum, there isn't really a concept of "document fragment" in libxml2
at least no such node is ever generated. A Document should be cloneable
xmlCopyDoc() does this at the API level. A subtree of a document is cloneable
using xmlDocCopyNode() with the recursive flag.

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]