Re: [xml] xmlNewDocProp() doesn't appear to do anything...



On Mon, Oct 14, 2002 at 03:31:15AM -0700, Sean Chittenden wrote:
Call me crazy, but, it seems like xmlNewDocProp() is broken.  I've
resorted to setting a property on the root node, but I'd think that
xmlNewDocProp() would behave the same... does it not?

  No. xmlNewDocProp() create a property, but does not attach it to
an element, it's created anyway, and it's the user's responsability
to attach it to an element.  But it has to be created in the context
of a document.

Alright... what's the purpose of this then?

  Create an attribute without knowing a priori what element will hold it.

Is this any different
from adding a property to the root element of a document?

  yes as I said the property is *NOT* linked to the tree.

this, added it to Ruby's libxml interface... but never saw the purpose
of this and am now just flat out confused as to its purpose.  -sc

  Honnestly reread what I wrote, I don't have a better explanation.

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]