|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.hp.hpl.sparta.Node | +--com.hp.hpl.sparta.Document
An XML Document.
Copyright (C) 2002 Hewlett-Packard Company. This file is part of Sparta, an XML Parser, DOM, and XPath library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Document
Inner Class Summary | |
class |
Document.Index
|
static interface |
Document.Observer
|
Constructor Summary | |
Document()
|
Method Summary | |
void |
addObserver(Document.Observer observer)
|
java.lang.Object |
clone()
Deep copy of this document. |
void |
deleteObserver(Document.Observer observer)
|
boolean |
equals(java.lang.Object thatO)
Two documents are equal IFF their document elements are equal. |
java.lang.Object |
getAnnotation()
|
Element |
getDocumentElement()
|
java.lang.String |
getSystemId()
|
void |
removeIndices()
|
void |
setAnnotation(java.lang.Object annotation)
Use by client to attach arbitrary data to DOM document. |
void |
setDocumentElement(Element rootElement)
|
void |
setSystemId(java.lang.String systemId)
|
java.lang.String |
toString()
Returns URL of systemID that was parsed or "MEMORY" of createed in memory. |
void |
toString(java.io.Writer writer)
Accumlate text nodes hierarchically. |
void |
toXml(java.io.Writer writer)
|
boolean |
xpathEnsure(java.lang.String xpath)
Just like Node.xpathEnsure, but also handles case of no documentElement. |
Document.Index |
xpathGetIndex(java.lang.String xpath)
For faster lookup by XPath return (creating if necessary) an index. |
boolean |
xpathHasIndex(java.lang.String xpath)
|
Element |
xpathSelectElement(java.lang.String xpath)
Select the first element that matches the absolute XPath expression in this document, or null if there is no match. |
java.util.Enumeration |
xpathSelectElements(java.lang.String xpath)
Select all the elements that match the absolute XPath expression in this document. |
java.lang.String |
xpathSelectString(java.lang.String xpath)
Select the first element that matches the absolute XPath expression in this document, or null if there is no match. |
java.util.Enumeration |
xpathSelectStrings(java.lang.String xpath)
Select all the strings that match the absolute XPath expression in this document. |
Methods inherited from class com.hp.hpl.sparta.Node |
getNextSibling, getOwnerDocument, getParentNode, getPreviousSibling, htmlEncode, toXml, xpathSetStrings |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Document()
Method Detail |
public java.lang.Object clone()
clone
in class Node
public java.lang.String getSystemId()
public void setSystemId(java.lang.String systemId)
public java.lang.String toString()
toString
in class Node
public Element getDocumentElement()
public void setDocumentElement(Element rootElement)
public java.lang.Object getAnnotation()
getAnnotation
in class Node
public void setAnnotation(java.lang.Object annotation)
setAnnotation
in class Node
public java.util.Enumeration xpathSelectElements(java.lang.String xpath) throws ParseException
xpathSelectElements
in class Node
public java.util.Enumeration xpathSelectStrings(java.lang.String xpath) throws ParseException
xpathSelectStrings
in class Node
public Element xpathSelectElement(java.lang.String xpath) throws ParseException
xpathSelectElement
in class Node
public java.lang.String xpathSelectString(java.lang.String xpath) throws ParseException
xpathSelectString
in class Node
public boolean xpathEnsure(java.lang.String xpath) throws ParseException
xpathEnsure
in class Node
public boolean xpathHasIndex(java.lang.String xpath)
public Document.Index xpathGetIndex(java.lang.String xpath) throws ParseException
Enumeration leaders; if( doc.xpathHasIndex( "/Team/Members[@firstName]" ){ //fast version Document.Index index = doc.xpathGetIndex( "/Team/Members[@role]" ); leaders = index.get("leader"); }else //slow version leaders = doc.xpathSelectElement( "/Team/Members[@role='leader']" );
public void removeIndices()
public void addObserver(Document.Observer observer)
public void deleteObserver(Document.Observer observer)
public void toString(java.io.Writer writer) throws java.io.IOException
public void toXml(java.io.Writer writer) throws java.io.IOException
public boolean equals(java.lang.Object thatO)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |