public class DOMUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DOMUtil.NodeListImpl
NodeListImpl
|
| Modifier and Type | Field and Description |
|---|---|
static DOMUtil |
UTIL
static object to access the methods of this object
|
| Constructor and Description |
|---|
DOMUtil()
Creates a new instance of DOMUtil
|
| Modifier and Type | Method and Description |
|---|---|
Document |
buildDOMDocument(Reader xmlReader)
return the DOM Document
|
Document |
buildDOMDocument(Reader xmlReader,
boolean nsAwareFlag)
return the DOM Document
|
Document |
buildDOMDocument(String xmlText)
return the DOM Document
|
String |
DOM2String(Document aDocument,
Writer aWriter)
save document to stream
|
Element |
getChildElement(Element aElement,
String aElementTagName)
get the child with the specified tag name
|
NodeList |
getChildElements(Element aElement,
String aElementTagName)
get the children of the same type element tag name
|
Element |
getElement(Document aParentDocument,
String aTagName)
gets the element
|
Element |
getElement(Element elem,
String tagName)
get the child element
|
String |
getElementName(Element aElement)
get Element Tag Name with striped prefix.
|
NodeList |
getElements(Document aParentDocument,
String aTagName)
gets set of elements
|
NodeList |
getElements(Element aParentElement,
String aTagName)
gets list of elements
|
String |
getElementValue(Document doc,
String elemName)
gets the element value
|
String |
getName(String aName)
strips the prefix of the name if present
|
String |
getTextData(Element aElement)
use this util method to retrieve a Text Data in a element
|
static String |
replaceXmlEntityReferecesToEscapeChars(String xmlString)
replaces the xml entity refereces with the xml escape chars
|
static String |
replaceXmlEscapeCharsToEntityRefereces(String xmlString)
replaces the xml entity refereces with the xml escape chars
|
void |
setTextData(Element aElement,
String aData)
use this util method to set a Text Data in a element
|
public static final DOMUtil UTIL
public Element getElement(Document aParentDocument, String aTagName)
aParentDocument - Document for parent nodeaTagName - String for tagnamepublic Element getElement(Element elem, String tagName)
elem - parent elementtagName - element to look forpublic String getElementValue(Document doc, String elemName)
doc - documentelemName - elementpublic void setTextData(Element aElement, String aData)
aElement - Element for text nodeaData - String contains textpublic String getTextData(Element aElement)
aElement - Element for text nodepublic String DOM2String(Document aDocument, Writer aWriter) throws Exception
aDocument - DocumentaWriter - is what the aDocument is serialized to.Exception - on errorpublic NodeList getElements(Element aParentElement, String aTagName)
aParentElement - Element for parentaTagName - String for tagnamepublic NodeList getElements(Document aParentDocument, String aTagName)
aParentDocument - Document for parent nodeaTagName - String for tagnamepublic NodeList getChildElements(Element aElement, String aElementTagName)
aElement - Element for parent nodeaElementTagName - String for tagnamepublic Element getChildElement(Element aElement, String aElementTagName)
aElement - Element for parent nodeaElementTagName - String for tagnamepublic String getElementName(Element aElement)
aElement - Element objectpublic String getName(String aName)
aName - String value of Name with prefixpublic Document buildDOMDocument(String xmlText) throws Exception
xmlText - StringException - on parser exception or any other exceptionpublic Document buildDOMDocument(Reader xmlReader) throws Exception
xmlReader - ReaderException - on parser exception or any other exceptionpublic Document buildDOMDocument(Reader xmlReader, boolean nsAwareFlag) throws Exception
xmlReader - ReadernsAwareFlag - indicating whether it is namespace awareness or notException - on parser exception or any other exceptionpublic static String replaceXmlEscapeCharsToEntityRefereces(String xmlString)
xmlString - Text with the xml xml escape charsText - with the xml entity referecesCopyright © 2011-2016 OpenESB Community. All Rights Reserved.