Re: [xml] Character Positions



On Mon, Jan 14, 2002 at 03:05:06PM -0000, Richard Jinks wrote:
Hi

Just been inspecting the libxml parser code with respect to putting in the
changes required to store start / end character positions, but from what I
can tell, most of the things are already in the code.

  Right, it's a relatively old contributed code.

How are the xmlParserNodeInfo structs stored? They appear to be kept in a
separate list / tree (xmlParserNodeInfoSeq) as opposed to being "attached"
to the normal DOM tree in some way? I've done a couple of tests (mainly by
setting ctxt->record_info = 1 in parserInternals.c xmlInitParserCtxt(), and
putting printf()'s everywhere), and it looks like libxml already records the
positions of nodes against the input stream.

  yes,

I'm guessing that this is only present for debugging purposes (hence it
being turned off by default).

  No it's just taht someone had a similar need than yours a long time ago.

As this set of functions is already present, it appears that the only
modifications I now need to make are to increase the use of these functions
to record the information for attributes and DTD nodes, and to add functions
to return the data to the calling application. Is this correct?

  sounds a simple way to implement your needs, yes.

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]