Discussion:
[XOM-interest] Location-aware Elements
Olivier Lefevre
2012-01-07 19:48:24 UTC
Permalink
I'd like to have location information in the final Document.
This is necessary if you are going to do post-processing and
maybe throw your own errors. Someone enquired in 2005 about
this and was rebuffed. Has anything changed since? How would
one go about doing this today? I don't care if that requires
me to write a custom NodeFactory.

Thanks,

-- O.L.
Elliotte Rusty Harold
2012-01-08 01:53:19 UTC
Permalink
Post by Olivier Lefevre
I'd like to have location information in the final Document.
This is necessary if you are going to do post-processing and
maybe throw your own errors. Someone enquired in 2005 about
this and was rebuffed. Has anything changed since? How would
one go about doing this today? I don't care if that requires
me to write a custom NodeFactory.
What location information do you want? Line number and column number?
If so that's not really possible. SAX does not reliably provide that
to XOM.
--
Elliotte Rusty Harold
elharo at ibiblio.org
Michael Kay
2012-01-08 17:14:05 UTC
Permalink
Post by Elliotte Rusty Harold
Post by Olivier Lefevre
I'd like to have location information in the final Document.
This is necessary if you are going to do post-processing and
maybe throw your own errors. Someone enquired in 2005 about
this and was rebuffed. Has anything changed since? How would
one go about doing this today? I don't care if that requires
me to write a custom NodeFactory.
What location information do you want? Line number and column number?
If so that's not really possible. SAX does not reliably provide that
to XOM.
I can think of good reasons for saying 'no' to this request, but this
isn't one of them. Saxon has been using the position information
provided by SAX parsers for years (for reporting the location of errors
in stylesheets and validation errors in instance documents). It's
generally very reliable. One can complain that it's not fine-grained
enough, but it's perfectly adequate for this kind of purpose (you get
the position of the '>' at the end of the start tag of every element).

Michael Kay
Saxonica
Olivier Lefevre
2012-01-16 21:36:30 UTC
Permalink
Post by Elliotte Rusty Harold
Post by Olivier Lefevre
I'd like to have location information in the final Document.
This is necessary if you are going to do post-processing and
maybe throw your own errors. Someone enquired in 2005 about
this and was rebuffed. Has anything changed since? How would
one go about doing this today? I don't care if that requires
me to write a custom NodeFactory.
What location information do you want? Line number and column number?
If so that's not really possible. SAX does not reliably provide that
to XOM.
Sorry for the delay. Line number would be good enough.

-- O.L.

Continue reading on narkive:
Loading...