com.vhosting.netconf.messages
Class DOMUtils

java.lang.Object
  extended by com.vhosting.netconf.messages.DOMUtils

public class DOMUtils
extends java.lang.Object

This class provides some methods for manipulating XML documents used to handle the protocol.

Version:
1.00, 02/11/2010
Author:
Giuseppe Palmeri

Method Summary
static void dump(org.w3c.dom.Document doc, java.io.OutputStream out)
          Dump a DOM XML Document to an output stream.
static org.w3c.dom.Document newDocument()
          Create a new empty DOM XML Document.
static org.w3c.dom.Document newDocument(java.io.InputStream in)
          Create a new DOM XML Document from an input stream.
static boolean validate(org.w3c.dom.Document doc, java.net.URL xsd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newDocument

public static org.w3c.dom.Document newDocument()
Create a new empty DOM XML Document.

Returns:
The empty DOM XML Document.

newDocument

public static org.w3c.dom.Document newDocument(java.io.InputStream in)
                                        throws org.xml.sax.SAXException,
                                               java.io.IOException
Create a new DOM XML Document from an input stream.

Parameters:
in - The input stream.
Returns:
The new DOM XML Document.
Throws:
org.xml.sax.SAXException - Throw this exception if there are parsing troubles.
java.io.IOException - Throw this exception if there are reading troubles.

dump

public static void dump(org.w3c.dom.Document doc,
                        java.io.OutputStream out)
                 throws java.io.IOException
Dump a DOM XML Document to an output stream.

Parameters:
doc - The DOM XML Document.
out - The output stream.
Throws:
java.io.IOException - Throw this exception if there are writing troubles.

validate

public static boolean validate(org.w3c.dom.Document doc,
                               java.net.URL xsd)