You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Peter Farland <pf...@adobe.com> on 2009/05/06 00:33:26 UTC

Xerces 2 - SAX Attributes and Line Numbers

Hi,

Unfortunately the SAX Attributes API does not provide an API to query for the line number on which an attribute was declared.

I took a quick look through the Xerces2-J JIRA bug repository and didn't see any enhancements logged for this limitation there either.

Does anyone know if there's a Xerces-specific API to get the original line number for an attribute (as attributes are often not on the same as the opening tag)?

Thanks,
    Pete

---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: Xerces 2 - SAX Attributes and Line Numbers

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Pete,

Xerces doesn't track the position of attributes. I don't know of any XML
parser that does. It imposes additional overhead for information that an
application is unlikely to be read, primarily because it isn't exposed
through any of the XML APIs (JAXP, JAXB, etc...) available in Java SE.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Peter Farland <pf...@adobe.com> wrote on 05/05/2009 06:33:26 PM:

> Hi,
>
> Unfortunately the SAX Attributes API does not provide an API to
> query for the line number on which an attribute was declared.
>
> I took a quick look through the Xerces2-J JIRA bug repository and
> didn't see any enhancements logged for this limitation there either.
>
> Does anyone know if there's a Xerces-specific API to get the
> original line number for an attribute (as attributes are often not
> on the same as the opening tag)?
>
> Thanks,
>     Pete
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org