X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=trunk%2Fsupport%2Fsrc%2Forg%2Fwamblee%2Fxml%2FDomUtils.java;h=3718debf782529b075591a141813cd6e83162d98;hb=13ed890d3fea02a6d32d8ec43d88e9e827130018;hp=75ba7f6ddefeb1d4a20a35e9f30651d05608d5b7;hpb=46c43c5dfb13ed1aa799f4de802195145399f13e;p=utils diff --git a/trunk/support/src/org/wamblee/xml/DomUtils.java b/trunk/support/src/org/wamblee/xml/DomUtils.java index 75ba7f6d..3718debf 100644 --- a/trunk/support/src/org/wamblee/xml/DomUtils.java +++ b/trunk/support/src/org/wamblee/xml/DomUtils.java @@ -16,6 +16,7 @@ package org.wamblee.xml; +import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -56,6 +57,15 @@ public final class DomUtils { // Empty. } + /** + * Parses an XML document from a string. + * @param aDocument document. + * @return + */ + public static Document read(String aDocument) throws SAXException, ParserConfigurationException, IOException { + ByteArrayInputStream is = new ByteArrayInputStream(aDocument.getBytes()); + return read(is); + } /** * Parses an XML document from a stream.