net.bioclipse.xws
Class JavaDOMTools

java.lang.Object
  extended by net.bioclipse.xws.JavaDOMTools

public class JavaDOMTools
extends java.lang.Object


Constructor Summary
JavaDOMTools()
           
 
Method Summary
static org.w3c.dom.Element createElement(java.lang.String element_name)
          Creates an Element with the specified name.
static org.w3c.dom.Element createElement(java.lang.String namespace, java.lang.String element_name)
          Creates an Element with the specified name, and the given namespace.
static org.w3c.dom.Element getXmlFileRootElement(java.lang.String file_name)
          Returns the root element of a XML file.
static org.w3c.dom.Element string2Element(java.lang.String element_string)
          Converts a String into an Element.
static java.lang.String w3cElementToString(org.w3c.dom.Element in)
          Creates a String representation of the specified Element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaDOMTools

public JavaDOMTools()
Method Detail

createElement

public static org.w3c.dom.Element createElement(java.lang.String namespace,
                                                java.lang.String element_name)
                                         throws org.w3c.dom.DOMException,
                                                javax.xml.parsers.ParserConfigurationException
Creates an Element with the specified name, and the given namespace.

Parameters:
namespace - The namespace of the element.
element_name - The element name.
Returns:
The newly created element.
Throws:
org.w3c.dom.DOMException
javax.xml.parsers.ParserConfigurationException

createElement

public static org.w3c.dom.Element createElement(java.lang.String element_name)
                                         throws org.w3c.dom.DOMException,
                                                javax.xml.parsers.ParserConfigurationException
Creates an Element with the specified name.

Parameters:
element_name - The element name.
Returns:
The newly created element.
Throws:
org.w3c.dom.DOMException
javax.xml.parsers.ParserConfigurationException

getXmlFileRootElement

public static org.w3c.dom.Element getXmlFileRootElement(java.lang.String file_name)
                                                 throws XwsException
Returns the root element of a XML file.

Parameters:
file_name - The name of the file.
Returns:
The root element of the XML file.
Throws:
XwsException

string2Element

public static org.w3c.dom.Element string2Element(java.lang.String element_string)
                                          throws org.w3c.dom.DOMException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 java.io.IOException,
                                                 org.xml.sax.SAXException
Converts a String into an Element.

Parameters:
element_string - A String representation of an XML element.
Returns:
The Element representation.
Throws:
org.w3c.dom.DOMException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException

w3cElementToString

public static java.lang.String w3cElementToString(org.w3c.dom.Element in)
Creates a String representation of the specified Element.

Parameters:
in - The Element.
Returns:
The String representation.