public final class XmlUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
appendChild(SgmlPage page,
DomNode parent,
Node child,
boolean handleXHTMLAsHTML)
|
static void |
appendChild(SgmlPage page,
DomNode parent,
Node child,
boolean handleXHTMLAsHTML,
Map<Integer,List<String>> attributesOrderMap)
|
static Document |
buildDocument(WebResponse webResponse)
Builds a document from the content of the web response.
|
static Map<Integer,List<String>> |
getAttributesOrderMap(Document document)
Returns internal Xerces details about all elements in the specified document.
|
static String |
lookupNamespaceURI(DomElement element,
String prefix)
Search for the namespace URI of the given prefix, starting from the specified element.
|
static String |
lookupPrefix(DomElement element,
String namespace)
Search for the prefix associated with specified namespace URI.
|
public static Document buildDocument(WebResponse webResponse) throws IOException, SAXException, ParserConfigurationException
webResponse - the response from the serverIOException - if the page could not be createdSAXException - if the parsing failsParserConfigurationException - if a DocumentBuilder cannot be createdpublic static void appendChild(SgmlPage page, DomNode parent, Node child, boolean handleXHTMLAsHTML)
page - the owner page of DomElements to be createdparent - the parent DomNodechild - the child NodehandleXHTMLAsHTML - if true elements from the XHTML namespace are handled as HTML elements instead of
DOM elementspublic static void appendChild(SgmlPage page, DomNode parent, Node child, boolean handleXHTMLAsHTML, Map<Integer,List<String>> attributesOrderMap)
page - the owner page of DomElements to be createdparent - the parent DomNodechild - the child NodehandleXHTMLAsHTML - if true elements from the XHTML namespace are handled as HTML elements instead of
DOM elementsattributesOrderMap - (optional) the one returned by getAttributesOrderMap(Document)public static String lookupNamespaceURI(DomElement element, String prefix)
element - the element to start searching fromprefix - the namespace prefixpublic static String lookupPrefix(DomElement element, String namespace)
element - the element to start searching fromnamespace - the namespace prefixpublic static Map<Integer,List<String>> getAttributesOrderMap(Document document)
Map is the nodeIndex of an element, and the list
is the array of ordered attributes names.document - the documentCopyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.