mbeckerle commented on PR #7:
URL: https://github.com/apache/xerces-j/pull/7#issuecomment-2890802285

   > > > I find this PR useful, and the implementation changes looks ok to me. 
The test cases provided with this PR also looks ok to me.
   > > 
   > > 
   > > @mukulga if you add a +1 and approval then this will meet usual Apache 
guidance to be merged. If not I need help recruiting another Xerces committer 
to review this. Please advise.
   > 
   > @mbeckerle in this PR, you've already set DOMLocator object on DOM element 
nodes (via ((NodeImpl) el).setLocator(elemLoc)). I think, this needs to be done 
for DOM attribute nodes as well.
   
   @mukulga I would like to add this, but attributes do not have separate event 
callbacks. Method `AbstractDOMParser.startElement` gets called, and a single 
`fLocator` is provided for that entire element, and the code creates the 
attribute nodes in the context of that `startElement` call and `fLocator`.  The 
table of attributes presented to `startElement` does not contain any location 
information, and the SAX system which populates that table for the DOM system, 
also does not have any location information in its data structures. 
   
   Somewhere at the lowest levels the location information is present, because 
the `fLocator` does get populated for `startElement` to use. But the changes 
required seem to me like they would be extensive.
   
   Given no separate more-precise per-attribute location information, I suggest 
it is preferable for applications handling attribute nodes to call 
`getOwnerElement` first, and then get the associated element's location 
information. This makes it clear that the information provided does not have 
attribute-level accuracy for the source line/col information. This also 
preserves, for the future, the ability to add precise locator information to 
attributes without breaking applications or test cases changing the answer to 
`(NodeImpl) attr).getLocator()` which will just return null currently. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to