## com.gargoylesoftware.htmlunit.xml
Class XmlUtil

    java.lang.Object
      com.gargoylesoftware.htmlunit.xml.XmlUtil

    public final class XmlUtil

extends java.lang.Object

INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Provides facility method to work with XML responses.

Version:
  $Revision: 4806 $
Author:
  Marc Guillemot, Ahmed Ashour, Sudhan Moghe

Method Summary
`static void` `appendChild(SgmlPage page, DomNode parent, org.w3c.dom.Node child)` Recursively appends a `Node` child to `DomNode` parent.
`static org.w3c.dom.Document` `buildDocument(WebResponse webResponse)` Builds a document from the content of the web response.
`static java.lang.String` `lookupNamespaceURI(DomElement element, java.lang.String prefix)` Search for the namespace URI of the given prefix, starting from the specified element.
`static java.lang.String` `lookupPrefix(DomElement element, java.lang.String namespace)` Search for the prefix associated with specified namespace URI.

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

Method Detail

### buildDocument

    public static org.w3c.dom.Document buildDocument(WebResponse webResponse)
                                              throws java.io.IOException,
                                                     org.xml.sax.SAXException,
                                                     javax.xml.parsers.ParserConfigurationException

  Builds a document from the content of the web response. A warning is logged if an exception is thrown while parsing the XML content (for instance when the content is not a valid XML and can't be parsed).

  Parameters:
    `webResponse` - the response from the server
  Returns:
    the parse result
  Throws:
    `java.io.IOException` - if the page could not be created
    `org.xml.sax.SAXException` - if the parsing fails
    `javax.xml.parsers.ParserConfigurationException` - if a DocumentBuilder cannot be created

### appendChild

    public static void appendChild(SgmlPage page,
                                   DomNode parent,
                                   org.w3c.dom.Node child)

  Recursively appends a `Node` child to `DomNode` parent.

  Parameters:
    `page` - the owner page of `DomElement`s to be created
    `parent` - the parent DomNode
    `child` - the child Node

### lookupNamespaceURI

    public static java.lang.String lookupNamespaceURI(DomElement element,
                                                      java.lang.String prefix)

  Search for the namespace URI of the given prefix, starting from the specified element.

  Parameters:
    `element` - the element to start searching from
    `prefix` - the namespace prefix
  Returns:
    the namespace URI bound to the prefix; or null if there is no such namespace

### lookupPrefix

    public static java.lang.String lookupPrefix(DomElement element,
                                                java.lang.String namespace)

  Search for the prefix associated with specified namespace URI.

  Parameters:
    `element` - the element to start searching from
    `namespace` - the namespace prefix
  Returns:
    the prefix bound to the namespace URI; or null if there is no such namespace

Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.