[XML-SIG] A usage scenario for Python and XML...

Lars Marius Garshol larsga@garshol.priv.no
04 Jun 2000 12:17:54 +0200


* Greg Wolff
| 
| NOTE: Byte offsets are not available in SAX but are in SAX2.  They
| are available in Expat and the Perl Expat modules which we currently
| use for this purpose.  The older Java SAX api is unusable for this
| application.

I haven't yet made offsets available in SAX2, but I plan to do so in
the next release. I was thinking of two possible ways to do this:

  - a SAX2 parser property that returns the current offset
  - a SAX2 parser property that returns a function that returns the
    current offset

The first is the least surprising way, but I think the second is
likely to be faster and also more convenient. Opinions on this would
be welcome.

Support for this property will of course be optional, but both expat
and xmlproc will support it, since they both provide the necessary
information. If any other parsers provide it they will also support
the property.

| Major Requirement: Complete location information, including byte
| offsets, are required at all relevant element start and end tag
| instances.

With the addition of the byte offset information SAX 2 should cover
your requirements, I assume?

BTW: Thank you for a very interesting post. It's always interesting to
     know what people are using this software for.

--Lars M.