mbeckerle commented on code in PR #7:
URL: https://github.com/apache/xerces-j/pull/7#discussion_r2019358513
##########
src/org/apache/xerces/parsers/AbstractDOMParser.java:
##########
@@ -933,6 +940,10 @@ public void startElement (QName element, XMLAttributes
attributes, Augmentations
return;
}
Element el = createElementNode (element);
+ // Extract location info if feature is enabled
+ if (fIncludeLocationInfo) {
+ el.setUserData( Constants.LOCATION_INFO, String.valueOf(
fLocator.getLineNumber() ), null ); // Save location String into node
Review Comment:
Good point. I will change them to Integers or DOM locators per your other
comment.
I would be happy to consider a different mechanism for carrying this line
number data.
This is a handy one, but I could devote an actual member on dom Elements to
this. That would require users to downcast to a Xerces specific
XMLEnhancedElement (say) interface to access it. Is that preferable?
But even if we keep it on the user data, a good point also is the word
"location" isn't sufficiently unique if this user data structure is being used
for an internal mechanism. It should be a more unique string along the lines of
a xerces internal URN.
--
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]