XML technologies / XML / XML in a Nutshell / DOM reference / Object reference / DOMLocator

(Excerpt from "XML in a Nutshell" by Elliotte Rusty Harold & W. Scott Means)

This interface describes an object that can identify a particular location in a document while it is processed by a DOM implementation.

 

Attributes

The object DOMLocator has the following attributes:

 

byteOffset: long (3)

The byte offset in the input source, or −1 if no byte offset is available. Read-only.

Java binding
public int getByteOffset( );

 

columnNumber: long (3)

The column number within the line in the input source, or −1 if no column number is available. Read-only.

Java binding
public int getColumnNumber( );

 

lineNumber: long (3)

The line number in the input source, or −1 if no line number is available. Read-only.

Java binding
public int getLineNumber( );

 

relatedNode: Node (3)

This attribute contains a reference to the DOM Node object corresponding to the location in question in the document. Read-only.

Java binding
public Node getRelatedNode( )

 

uri: DOMString (3)

The URI of the source document, or null, if no URI is available. Read-only.

Java binding
public String getUri( );

 

utf16Offset: long (3)

Similar to the byte offset attribute, but instead of an absolute byte position, it returns a UTF character offset according to the Unicode specification. For more information about character encodings and Unicode, see Internationalization. Read-only.

Java binding
public int getUtf16Offset( );

 

Methods

The object DOMLocator has no methods.

  

 

 

 

back to top