[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: A question of SAX specification

  • From: David Megginson <david@m...>
  • To: xml-dev@i...
  • Date: 01 Oct 1999 13:22:31 -0400

sax column
John Cowan <cowan@l...> writes:

> > The idea of Locator was simply to help get a user close to an error in
> > a document: exactly how it works is deliberately unspecified, mainly
> > to keep life easy for parser writers (since different parsers use
> > different tokenization and look-ahead schemes).  Locator is not
> > designed to let you extract text strings from the original document.
> 
> Yes, but it would have been nice to define whether the first column
> in each line is column 1 or column 0, which is obviously the problem
> above.  Ditto with line 1 or line 0.

See the JavaDoc documentation for the Locator interface: "The first
column in a line is position 1":

  http://www.megginson.com/SAX/javadoc/org.xml.sax.Locator.html#getColumnNumber()

(Granted, it doesn't say the same about the first line, but I've never
heard of zero-based line numbering).

That might not be the problem here in any case.  One parser is
returning the position of the last character in the start tag, while
the other is returning the position of the first character past the
end of the start tag -- both are OK (as would be the first character
of the start tag), because they're close enough to bring a human
reader to the right general vicinity in the source document.

Remember that a major goal of SAX 1.0 was to impose as little as
possible on the programmer: we didn't want to force programmers to
track a lot of extra information if they didn't want to.


All the best,


David

-- 
David Megginson                 david@m...
           http://www.megginson.com/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.