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,["public interface **DOMLocator** implements [SourceLocator](../../../../../reference/javax/xml/transform/SourceLocator.html) \nIndicates the position of a node in a source DOM, intended\nprimarily for error reporting. To use a DOMLocator, the receiver of an\nerror must downcast the [SourceLocator](../../../../../reference/javax/xml/transform/SourceLocator.html)\nobject returned by an exception. A [Transformer](../../../../../reference/javax/xml/transform/Transformer.html)\nmay use this object for purposes other than error reporting, for instance,\nto indicate the source node that originated a result node. \n\nPublic Method Summary\n\n|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Node](../../../../../reference/org/w3c/dom/Node.html) | [getOriginatingNode](../../../../../reference/javax/xml/transform/dom/DOMLocator.html#getOriginatingNode())() Return the node where the event occurred. |\n\nInherited Method Summary \nFrom interface [javax.xml.transform.SourceLocator](../../../../../reference/javax/xml/transform/SourceLocator.html) \n\n|-------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract int | [getColumnNumber](../../../../../reference/javax/xml/transform/SourceLocator.html#getColumnNumber())() Return the character position where the current document event ends. |\n| abstract int | [getLineNumber](../../../../../reference/javax/xml/transform/SourceLocator.html#getLineNumber())() Return the line number where the current document event ends. |\n| abstract [String](../../../../../reference/java/lang/String.html) | [getPublicId](../../../../../reference/javax/xml/transform/SourceLocator.html#getPublicId())() Return the public identifier for the current document event. |\n| abstract [String](../../../../../reference/java/lang/String.html) | [getSystemId](../../../../../reference/javax/xml/transform/SourceLocator.html#getSystemId())() Return the system identifier for the current document event. |\n\nPublic Methods \n\npublic abstract [Node](../../../../../reference/org/w3c/dom/Node.html)\n**getOriginatingNode**\n() \nReturn the node where the event occurred. \n\nReturns\n\n- The node that is the location for the event."]]