|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.hp.hpl.sparta.Node
An XML node.
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.
Constructor Summary | |
Node()
|
Method Summary | |
java.lang.Object |
clone()
Return a deep copy of this node. |
java.lang.Object |
getAnnotation()
|
Node |
getNextSibling()
|
Document |
getOwnerDocument()
null IFF this is a Document |
Element |
getParentNode()
|
Node |
getPreviousSibling()
|
protected static void |
htmlEncode(java.io.Writer writer,
java.lang.String string)
Quote special XML characters '<', '>', '&', '"' if necessary, and write to character stream. |
void |
setAnnotation(java.lang.Object annotation)
Use by client to attach arbitrary data to DOM document. |
java.lang.String |
toString()
Hierarchically concatenated text nodes. |
java.lang.String |
toXml()
|
boolean |
xpathEnsure(java.lang.String xpath)
Make sure this XPath exists, creating nodes if necessary, returning true if any nodes created. |
abstract Element |
xpathSelectElement(java.lang.String xpath)
Select the first element that matches the relative XPath expression with respect to this node, or null if there is no match. |
abstract java.util.Enumeration |
xpathSelectElements(java.lang.String xpath)
Select all the elements that match the relative XPath expression with respect to this node. |
abstract java.lang.String |
xpathSelectString(java.lang.String xpath)
Select the first element that matches the relative XPath expression with respect to this node, or null if there is no match. |
abstract java.util.Enumeration |
xpathSelectStrings(java.lang.String xpath)
Select all the strings that match the relative XPath expression with respect to this node. |
void |
xpathSetStrings(java.lang.String xpath,
java.lang.String value)
For an xpath expression of the form "xpathPrefix/@attrName" set the attribute "attrName" to attrValue on all elements that match "XpathPrefix" which is an arbitrary xpath expression matching elements, or for an xpath expression of the form "xpathPrefixe/text()" set the text of all matching text nodes. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Node()
Method Detail |
public Document getOwnerDocument()
public Element getParentNode()
public Node getPreviousSibling()
public Node getNextSibling()
public java.lang.Object getAnnotation()
public void setAnnotation(java.lang.Object annotation)
public java.lang.String toXml() throws java.io.IOException
public void xpathSetStrings(java.lang.String xpath, java.lang.String value) throws ParseException
foreach element in node.xpathSelectElement(xpathPrefix): element.setAttribute( "attrName", value );
(Every matching child gets its attribute set.)
TTT TTT TTT
TTT
public boolean xpathEnsure(java.lang.String xpath) throws ParseException
public abstract java.util.Enumeration xpathSelectElements(java.lang.String xpath) throws ParseException
public abstract java.util.Enumeration xpathSelectStrings(java.lang.String xpath) throws ParseException
public abstract Element xpathSelectElement(java.lang.String xpath) throws ParseException
public abstract java.lang.String xpathSelectString(java.lang.String xpath) throws ParseException
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected static void htmlEncode(java.io.Writer writer, java.lang.String string) throws java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |