Skip to Content.
Sympa Menu

xom-interest - RE: [XOM-interest] location of elements?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Michael Kay" <mike AT saxonica.com>
  • To: "'Elliotte Harold'" <elharo AT metalab.unc.edu>, "'Frankpeter Lohse'" <frape AT frapelo.de>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: RE: [XOM-interest] location of elements?
  • Date: Mon, 30 May 2005 17:16:20 +0100

> >
> > I would like to show the location (row, column) of XML elements in
> > error messages while dealing with the XOM XML tree.
> Creating my own
> > NodeFactory doesn't help because I don't have access to
> the XOMHandlers
> > Location object.
> >
>
> XOM doesn't provide that. Row-columns are two layers below the
> information XOM exposes. That's down in the lexical layer.
> XOM exposes
> the structure layer. I know it would be useful for error
> reporting, but
> offering it would require contorting the API far too much, not to
> mention writing my own SAX parser.

With respect, those are not very good reasons. SAX parsers already provide
the information, and it can be delivered over the API by a single method
getLocation() with a corresponding return class. The implementation of
course is a bit complicated because you have to store the information "out
of band" so there is zero overhead for people who don't need it.

So by all means reject the requirement, but not for these reasons!

Michael Kay






Archive powered by MHonArc 2.6.24.

Top of Page