Re: Line numbers and other information in XML parsing

Eric Bezault <[email protected]> Thu, 09 Apr 2009 10:12:49 +0200
Newsgroups gmane.comp.lang.eiffel.gobo.devel
Message-ID <[email protected]>
Sandro De Zanet wrote:
> What is the best method of figuring out data like line or column numbers
> while parsing XML?
> 
> I use the XM_EIFFEL_PARSER with an implementation of XM_CALLBACKS. The
> provided features (callbacks) do not allow to query the current parse
> position in the file. I solve the problem by passing the
> XM_EIFFEL_PARSER instance to the implementation of XM_CALLBACKS.
> 
> Is there a better way of doing this?

It looks like that's how it's done in XM_CALLBACKS_TO_TREE_FILTER.
You have to first call `enable_position_table' to pass the parser.
Then `handle_position' is able to fill in `last_position_table'.

-- 
Eric Bezault
mailto:[email protected]
http://www.gobosoft.com

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com