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



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.

Ahhh...  I guess that's the only function that'll do that.  Makes
sense now.  I shouldn't be asking questions when the clock reads a
two minutes to four.  :)

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.

When reading over the source I missed that it was the only function
that would let you create this ahead of time.  For some reason I
thought xmlNewProp() did this but xmlNewProp() attaches the attr to
the node passed and isn't more generic.  -sc


FWIW, I just released 0.03 of Ruby's libxml interface.  It's
progressing quite well for the most part.

http://lists.rubynet.org/lists/pipermail/rubynet-devel/2002-October/000164.html

-- 
Sean Chittenden



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