(no commit message)
[utils] / support / src / org / wamblee / xml / DomUtils.java
index 75ba7f6ddefeb1d4a20a35e9f30651d05608d5b7..3718debf782529b075591a141813cd6e83162d98 100644 (file)
@@ -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.