mbeckerle commented on code in PR #7:
URL: https://github.com/apache/xerces-j/pull/7#discussion_r2021828138


##########
src/org/apache/xerces/parsers/AbstractDOMParser.java:
##########
@@ -933,6 +942,11 @@ public void startElement (QName element, XMLAttributes 
attributes, Augmentations
                 return;
             }
             Element el = createElementNode (element);
+            // Extract location info if feature is enabled
+            if (fIncludeLocationInfo) {
+                DOMLocator elemLoc = new 
DOMLocatorImpl(fLocator.getLineNumber(), fLocator.getColumnNumber(), null);

Review Comment:
   fLocator is of type XMLLocator not DOMLocator, and its state gets mixed into 
other objects and it is mutated, so we have to copy out of it. 
   
   However, there is other info we can copy which is appropriate for a 
DOMLocator, and DOMLocators reference their node, so I changed this to copy as 
much as possible and provide the related node arg also. 



-- 
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: j-dev-unsubscr...@xerces.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to