|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.common.xml.MCRXMLHelper
public class MCRXMLHelper
This class provides some static utility methods to deal with XML/DOM elements, nodes etc. The class *must* be considered as "work in progress"! There is plenty left to do.
| Constructor Summary | |
|---|---|
MCRXMLHelper()
|
|
| Method Summary | |
|---|---|
static boolean |
deepEqual(Document d1,
Document d2)
checks whether two documents are equal. |
static MCRParserInterface |
getParser()
Returns the XML Parser as configured in mycore.properties |
static Document |
parseURI(URI uri)
Parses an XML file from a URI and returns it as DOM. |
static Document |
parseURI(URI uri,
boolean valid)
Parses an XML file from a URI and returns it as DOM. |
static Document |
parseXML(byte[] xml)
Parses an Byte Array and returns it as DOM. |
static Document |
parseXML(byte[] xml,
boolean valid)
Parses an Byte Array and returns it as DOM. |
static Document |
parseXML(String xml)
Parses an XML String and returns it as DOM. |
static Document |
parseXML(String xml,
boolean valid)
Parses an XML String and returns it as DOM. |
static String |
removeIllegalChars(String text)
Removes characters that are illegal in XML text nodes or attribute values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MCRXMLHelper()
| Method Detail |
|---|
public static MCRParserInterface getParser()
throws MCRException
MCRException
public static Document parseURI(URI uri)
throws MCRException
uri - the URI of the XML file
MCRException - if XML could not be parsed
public static Document parseURI(URI uri,
boolean valid)
throws MCRException
uri - the URI of the XML filevalid - the validation flag
MCRException - if XML could not be parsed
public static Document parseXML(String xml)
throws MCRException
xml - the XML String to be parsed
MCRException - if XML could not be parsed
public static Document parseXML(String xml,
boolean valid)
throws MCRException
xml - the XML String to be parsedvalid - the validation flag
MCRException - if XML could not be parsed
public static Document parseXML(byte[] xml)
throws MCRException
xml - the XML Byte Array to be parsed
MCRException - if XML could not be parsed
public static Document parseXML(byte[] xml,
boolean valid)
throws MCRException
xml - the XML Byte Array to be parsedvalid - the validation flag
MCRException - if XML could not be parsedpublic static String removeIllegalChars(String text)
text - the String that should be used in XML elements or attributes
public static boolean deepEqual(Document d1,
Document d2)
d1 - first Document to compared2 - second Document to compare
Document.equals(java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||