org.apache.xerces.validators.schema
Class XUtil

java.lang.Object
  |
  +--org.apache.xerces.validators.schema.XUtil

public class XUtil
extends java.lang.Object

Some useful utility methods.


Constructor Summary
protected XUtil()
          This class cannot be instantiated.
 
Method Summary
static void copyInto(Node src, Node dest)
          Copies the source tree into the specified place in a destination tree.
static Element getFirstChildElement(Node parent)
          Finds and returns the first child element node.
static Element getFirstChildElement(Node parent, java.lang.String elemName)
          Finds and returns the first child node with the given name.
static Element getFirstChildElement(Node parent, java.lang.String[] elemNames)
          Finds and returns the first child node with the given name.
static Element getFirstChildElement(Node parent, java.lang.String elemName, java.lang.String attrName, java.lang.String attrValue)
          Finds and returns the first child node with the given name and attribute name, value pair.
static Element getNextSiblingElement(Node node)
          Finds and returns the next sibling element node.
static Element getNextSiblingElement(Node node, java.lang.String elemName)
          Finds and returns the next sibling node with the given name.
static Element getNextSiblingElement(Node node, java.lang.String[] elemNames)
          Finds and returns the next sibling node with the given name.
static Element getNextSiblingElement(Node node, java.lang.String elemName, java.lang.String attrName, java.lang.String attrValue)
          Finds and returns the next sibling node with the given name and attribute name, value pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XUtil

protected XUtil()
This class cannot be instantiated.
Method Detail

copyInto

public static void copyInto(Node src,
                            Node dest)
                     throws DOMException
Copies the source tree into the specified place in a destination tree. The source node and its children are appended as children of the destination node.

Note: This is an iterative implementation.


getFirstChildElement

public static Element getFirstChildElement(Node parent)
Finds and returns the first child element node.

getNextSiblingElement

public static Element getNextSiblingElement(Node node)
Finds and returns the next sibling element node.

getFirstChildElement

public static Element getFirstChildElement(Node parent,
                                           java.lang.String elemName)
Finds and returns the first child node with the given name.

getNextSiblingElement

public static Element getNextSiblingElement(Node node,
                                            java.lang.String elemName)
Finds and returns the next sibling node with the given name.

getFirstChildElement

public static Element getFirstChildElement(Node parent,
                                           java.lang.String[] elemNames)
Finds and returns the first child node with the given name.

getNextSiblingElement

public static Element getNextSiblingElement(Node node,
                                            java.lang.String[] elemNames)
Finds and returns the next sibling node with the given name.

getFirstChildElement

public static Element getFirstChildElement(Node parent,
                                           java.lang.String elemName,
                                           java.lang.String attrName,
                                           java.lang.String attrValue)
Finds and returns the first child node with the given name and attribute name, value pair.

getNextSiblingElement

public static Element getNextSiblingElement(Node node,
                                            java.lang.String elemName,
                                            java.lang.String attrName,
                                            java.lang.String attrValue)
Finds and returns the next sibling node with the given name and attribute name, value pair. Since only elements have attributes, the node returned will be of type Node.ELEMENT_NODE.


Copyright © 1999 Apache XML Project. All Rights Reserved.