Class XmlFunctions
- java.lang.Object
-
- de.ipk_gatersleben.bit.bi.edal.primary_data.reference.datacite.XmlFunctions
-
public class XmlFunctions extends java.lang.ObjectUsefull function to handle XML files.
-
-
Constructor Summary
Constructors Constructor Description XmlFunctions()
-
Method Summary
Modifier and Type Method Description static org.w3c.dom.Documentparse(java.io.File xmlFile)parse.static org.w3c.dom.Documentparse(java.lang.String xmlString)Parse a string containing XML.static java.lang.StringtoString(org.w3c.dom.Document document)Convert XML DOM document to a string.static voidvalidate(java.net.URL schemaFile, org.w3c.dom.Document xmlDocument)Validate a XML-Documentagainst a XSD-SchemaFile.
-
-
-
Method Detail
-
parse
public static org.w3c.dom.Document parse(java.lang.String xmlString)
Parse a string containing XML.- Parameters:
xmlString- the XML string- Returns:
- XML DOM document
-
parse
public static org.w3c.dom.Document parse(java.io.File xmlFile)
parse.
- Parameters:
xmlFile- aFileobject.- Returns:
- a
Documentobject.
-
toString
public static java.lang.String toString(org.w3c.dom.Document document)
Convert XML DOM document to a string.- Parameters:
document- XML DOM document- Returns:
- XML string
-
validate
public static void validate(java.net.URL schemaFile, org.w3c.dom.Document xmlDocument) throws org.xml.sax.SAXException, java.io.IOExceptionValidate a XML-Documentagainst a XSD-SchemaFile.- Parameters:
schemaFile- the XSD-URL.xmlDocument- the XML-Document.- Throws:
org.xml.sax.SAXException- if there is an validation error.java.io.IOException- if unable to access the files.
-
-