DOMLocator
Stay organized with collections
Save and categorize content based on your preferences.
Indicates the position of a node in a source DOM, intended
primarily for error reporting. To use a DOMLocator, the receiver of an
error must downcast the SourceLocator
object returned by an exception. A Transformer
may use this object for purposes other than error reporting, for instance,
to indicate the source node that originated a result node.
Public Methods
public
abstract
Node
getOriginatingNode
()
Return the node where the event occurred.
Returns
- The node that is the location for the event.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eDOMLocator\u003c/code\u003e helps pinpoint the location of a node within a source DOM, mainly for error reporting in XML transformations.\u003c/p\u003e\n"],["\u003cp\u003eIt allows access to the node where an event occurred and inherits methods to identify the line and column number, public identifier, and system identifier of the event location.\u003c/p\u003e\n"],["\u003cp\u003eA \u003ccode\u003eTransformer\u003c/code\u003e can use \u003ccode\u003eDOMLocator\u003c/code\u003e for purposes beyond error reporting, such as tracking the source of result nodes.\u003c/p\u003e\n"]]],[],null,[]]