Re: [xml] custom payload on xmlNode* objects?

On Fri, Jan 14, 2005 at 09:47:31PM +0100, Martijn Faassen wrote:
Hi there,

I have been looking at the xmlNode* structure definition today to see 
whether there is a way to stuff a pointer onto it. This because I am 
exploring an idea of having backpointers to Python (object) 
datastructures in the nodes themselves in the design of the lxml library.

One candidate is the psvi field. What in libxml2 would break if I use 
this for my custom data?

  Right now, nothing. But once schemas PSVI support is added that may break
in horrible ways.

For my purposes, I mainly need this extra pointer on elements. Is the 
content field in use on element nodes, or could it safely be coopted? If 
it is in use, what is it?

  content should not be used on elements, it used to be for line numbers.
But what you really need to use is _private. I think it's what PHP 
(or is it libxml++ ?) uses for backpointers.


Daniel Veillard      | Red Hat Desktop team
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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