com.ibm.wsdl.util.xml
public class DOMUtils extends Object
Method Summary | |
---|---|
static String | cleanString(String orig) |
static int | countKids(Element elem, short nodeType)
Count number of children of a certain type of the given element.
|
static Element | findChildElementWithAttribute(Element elem, String attrName, String attrValue)
Return the first child element of the given element which has the
given attribute with the given value.
|
static String | getAttribute(Element el, String attrName)
Returns the value of an attribute of an element. |
static String | getAttribute(Element el, String attrName, List remainingAttrs)
Returns the value of an attribute of an element. |
static String | getAttributeNS(Element el, String namespaceURI, String localPart)
Returns the value of an attribute of an element. |
static List | getAttributes(Element el)
Returns a list of attributes of an element. |
static String | getChildCharacterData(Element parentEl)
Concat all the text and cdata node children of this elem and return
the resulting text.
|
static Element | getFirstChildElement(Element elem)
Return the first child element of the given element. |
static String | getNamespaceURIFromPrefix(Node context, 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 String | getPrefix(String namespaceURI, Definition def) |
static QName | getQName(String prefixedValue, Element contextEl, Definition def) |
static QName | getQualifiedAttributeValue(Element el, String attrName, String elDesc, boolean isRequired, Definition def)
This method should be used for elements that support extension attributes
because it does not track the remaining attributes to test for unexpected
attributes. |
static QName | getQualifiedAttributeValue(Element el, String attrName, String elDesc, boolean isRequired, Definition def, List remainingAttrs)
This method should be used for elements that do not support extension attributes
because it tracks the remaining attributes so that eventually any
unexpected attributes can be identified. |
static String | getQualifiedValue(String namespaceURI, String localPart, Definition def) |
static void | printAttribute(String name, String value, PrintWriter pw) |
static void | printQualifiedAttribute(QName name, String value, Definition def, PrintWriter pw)
Prints attributes with qualified names. |
static void | printQualifiedAttribute(QName name, QName value, Definition def, PrintWriter pw) |
static void | printQualifiedAttribute(String name, QName value, Definition def, PrintWriter pw) |
static void | registerUniquePrefix(String prefix, String namespaceURI, Definition def) |
static void | throwWSDLException(Element location) |
static void | throwWSDLException(Element location, List remainingAttrs) |
Parameters: elem the element whose kids are to be counted
Returns: the number of matching kids.
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.
Parameters: el Element whose attrib is looked for attrName name of attribute to look for
Returns: the attribute value
Parameters: el Element whose attrib is looked for attrName name of attribute to look for remainingAttrs List of remaining attributes
Returns: the attribute value
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
Parameters: el Element whose attributes are returned
Returns: the List of Attr
Parameters: parentEl the element whose cdata/text node values are to be combined.
Returns: the concatanated string.
Parameters: elem Element whose child is to be returned
Returns: the first child element.
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
Parameters: elem Element whose sibling element is to be returned
Returns: the next sibling element.