org.biojava3.core.util
Class XMLHelper

java.lang.Object
  extended by org.biojava3.core.util.XMLHelper

public class XMLHelper
extends Object

Author:
Scooter

Constructor Summary
XMLHelper()
           
 
Method Summary
static Element addChildElement(Element parentElement, String elementName)
           
static Document getNewDocument()
           
static Document inputStreamToDocument(InputStream inputStream)
           
static Document loadXML(String fileName)
           
static void outputToStream(Document document, OutputStream outputStream)
           
static void outputToStream(Element document, OutputStream outputStream)
           
static ArrayList<Element> selectElements(Element element, String xpathExpression)
           
static Element selectParentElement(Element element, String parentName)
           
static Element selectSingleElement(Element element, String xpathExpression)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLHelper

public XMLHelper()
Method Detail

addChildElement

public static Element addChildElement(Element parentElement,
                                      String elementName)

getNewDocument

public static Document getNewDocument()
                               throws Exception
Throws:
Exception

loadXML

public static Document loadXML(String fileName)
                        throws Exception
Throws:
Exception

inputStreamToDocument

public static Document inputStreamToDocument(InputStream inputStream)
                                      throws Exception
Throws:
Exception

outputToStream

public static void outputToStream(Document document,
                                  OutputStream outputStream)
                           throws Exception
Throws:
Exception

outputToStream

public static void outputToStream(Element document,
                                  OutputStream outputStream)
                           throws Exception
Throws:
Exception

selectParentElement

public static Element selectParentElement(Element element,
                                          String parentName)

selectSingleElement

public static Element selectSingleElement(Element element,
                                          String xpathExpression)
                                   throws Exception
Throws:
Exception

selectElements

public static ArrayList<Element> selectElements(Element element,
                                                String xpathExpression)
                                         throws Exception
Throws:
Exception