Line numbers and other information in XML parsing

2 messages Options
Embed this post
Permalink
Sandro De Zanet

Line numbers and other information in XML parsing

Reply Threaded More More options
Print post
Permalink
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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?

- --
Sandro
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknbx0MACgkQMQrpLaQQ008rZACfauXnJFe4Z2a+58srYmgnmZWF
UA0An21c8tbB1AnlhtTdjbTmDh1c1CjU
=cbbQ
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
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
_______________________________________________
gobo-eiffel-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gobo-eiffel-develop
Eric Bezault

Re: Line numbers and other information in XML parsing

Reply Threaded More More options
Print post
Permalink
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:[hidden email]
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
_______________________________________________
gobo-eiffel-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gobo-eiffel-develop