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 Ron Rothblum <RO...@il.ibm.com> on 2003/03/25 10:45:07 UTC

attribute location

Is there a way to find the location (line and more importantly column) of
an attribute using the dom parser? for example if we have a node such as:

<an_element an_attribute="the attributes value">

 we could find the location of both the name ("an attribute") of the
attribute and the value("the attributes value). A possible way to do this
is to override the startElement method of the dom parser, this method
receives as a parameter an array of the attributes of the element so I
could theoretically just measure the length of the strings (name and value)
and calculate the place of each attribute. This method it is not very
elegant and any extra whitespace will result in a wrong result.
Suggestions?

Ron Rothblum.


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