Package org.biojava.nbio.core.util
Class XMLHelper
- java.lang.Object
-
- org.biojava.nbio.core.util.XMLHelper
-
-
Constructor Summary
Constructors Constructor Description XMLHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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)
-
-
-
Constructor Detail
-
XMLHelper
public XMLHelper()
-
-
Method Detail
-
addChildElement
public static Element addChildElement(Element parentElement, String elementName)
-
getNewDocument
public static Document getNewDocument() throws ParserConfigurationException
- Throws:
ParserConfigurationException
-
loadXML
public static Document loadXML(String fileName) throws SAXException, IOException, ParserConfigurationException
-
inputStreamToDocument
public static Document inputStreamToDocument(InputStream inputStream) throws SAXException, IOException, ParserConfigurationException
-
outputToStream
public static void outputToStream(Document document, OutputStream outputStream) throws TransformerException
- Throws:
TransformerException
-
outputToStream
public static void outputToStream(Element document, OutputStream outputStream) throws TransformerException
- Throws:
TransformerException
-
selectParentElement
public static Element selectParentElement(Element element, String parentName)
-
selectSingleElement
public static Element selectSingleElement(Element element, String xpathExpression) throws XPathExpressionException
- Throws:
XPathExpressionException
-
selectElements
public static ArrayList<Element> selectElements(Element element, String xpathExpression) throws XPathExpressionException
- Throws:
XPathExpressionException
-
-