Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle® Application Server XML Java API Reference 10g Release 2 (10.1.2) Part no. B12024-03 September 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.soap.util.xml
Class DOMUtils

    java.lang.Object
      |
      +--org.apache.soap.util.xml.DOMUtils

public class DOMUtils
extends java.lang.Object

Constructor Summary
`DOMUtils()`

Method Summary
`static int` | `countKids(Element elem, short nodeType)` Count number of children of a certain type of the given element.
`static Element` | `findChildElementWithAttribute(Element elem, java.lang.String attrName, java.lang.String attrValue)` Return the first child element of the given element which has the given attribute with the given value.
`static java.lang.String` | `getAttribute(Element el, java.lang.String attrName)` Returns the value of an attribute of an element.
`static java.lang.String` | `getAttributeNS(Element el, java.lang.String namespaceURI, java.lang.String localPart)` Returns the value of an attribute of an element.
`static java.lang.String` | `getChildCharacterData(Element parentEl)` Concat all the text and cdata node children of this elem and return the resulting text.
`static Element` | `getElementByID(Element el, java.lang.String id)`
`static Element` | `getFirstChildElement(Element elem)` Return the first child element of the given element.
`static java.lang.String` | `getNamespaceURIFromPrefix(Node context, java.lang.String prefix)` Given a prefix and a node, return the namespace URI that the prefix has been associated with.
`static Element` | `getNextSiblingElement(Element elem)` Return the next sibling element of the given element.
`static QName` | `getQualifiedAttributeValue(Element el, java.lang.String attrName)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DOMUtils

    public DOMUtils()

Method Detail

### getAttribute

    public static java.lang.String getAttribute(Element el,
                                                java.lang.String attrName)

  Returns the value of an attribute of an element. Returns null if the attribute is not found (whereas Element.getAttribute returns "" if an attrib is not found).
  Parameters:
    `el` - Element whose attrib is looked for
    `attrName` - name of attribute to look for
  Returns:
    the attribute value

### getAttributeNS

    public static java.lang.String getAttributeNS(Element el,
                                                  java.lang.String namespaceURI,
                                                  java.lang.String localPart)

  Returns the value of an attribute of an element. Returns null if the attribute is not found (whereas Element.getAttributeNS returns "" if an attrib is not found).
  Parameters:
    `el` - Element whose attrib is looked for
    `namespaceURI` - namespace URI of attribute to look for
    `localPart` - local part of attribute to look for
  Returns:
    the attribute value

### getChildCharacterData

    public static java.lang.String getChildCharacterData(Element parentEl)

  Concat all the text and cdata node children of this elem and return the resulting text.
  Parameters:
    `parentEl` - the element whose cdata/text node values are to be combined.
  Returns:
    the concatanated string.

### getFirstChildElement

    public static Element getFirstChildElement(Element elem)

  Return the first child element of the given element. Null if no children are found.
  Parameters:
    `elem` - Element whose child is to be returned
  Returns:
    the first child element.

### getNextSiblingElement

    public static Element getNextSiblingElement(Element elem)

  Return the next sibling element of the given element. Null if no more sibling elements are found.
  Parameters:
    `elem` - Element whose sibling element is to be returned
  Returns:
    the next sibling element.

### findChildElementWithAttribute

    public static Element findChildElementWithAttribute(Element elem,
                                                        java.lang.String attrName,
                                                        java.lang.String attrValue)

  Return the first child element of the given element which has the given attribute with the given value.
  Parameters:
    `elem` - the element whose children are to be searched
    `attrName` - the attrib that must be present
    `attrValue` - the desired value of the attribute
  Returns:
    the first matching child element.

### countKids

    public static int countKids(Element elem,
                                short nodeType)

  Count number of children of a certain type of the given element.
  Parameters:
    `elem` - the element whose kids are to be counted
  Returns:
    the number of matching kids.

### getNamespaceURIFromPrefix

    public static java.lang.String getNamespaceURIFromPrefix(Node context,
                                                             java.lang.String prefix)

  Given a prefix and a node, return the namespace URI that the prefix has been associated with. This method is useful in resolving the namespace URI of attribute values which are being interpreted as QNames. If prefix is null, this method will return the default namespace.
  Parameters:
    `context` - the starting node (looks up recursively from here)
    `prefix` - the prefix to find an xmlns:prefix=uri for
  Returns:
    the namespace URI or null if not found

### getElementByID

    public static Element getElementByID(Element el,
                                         java.lang.String id)

### getQualifiedAttributeValue

    public static QName getQualifiedAttributeValue(Element el,
                                                   java.lang.String attrName)
                                            throws java.lang.IllegalArgumentException

    `java.lang.IllegalArgumentException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle® Application Server XML Java API Reference 10g Release 2 (10.1.2) Part no. B12024-03 September 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 The Apache Software Foundation. All rights reserved.