From c79214846bc6a5bc91b1411ac18edf16ce6b487f Mon Sep 17 00:00:00 2001 From: hns Date: Wed, 5 Jun 2002 18:11:21 +0000 Subject: [PATCH] made parsing more flexible by allowing InputSource parameter additionally to InputStream --- src/helma/objectmodel/dom/XmlReader.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/helma/objectmodel/dom/XmlReader.java b/src/helma/objectmodel/dom/XmlReader.java index 7bef5a94..5303ade5 100644 --- a/src/helma/objectmodel/dom/XmlReader.java +++ b/src/helma/objectmodel/dom/XmlReader.java @@ -4,6 +4,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; +import java.io.Reader; import java.text.SimpleDateFormat; import java.text.ParseException; @@ -13,6 +14,7 @@ import java.util.Hashtable; import java.util.List; import org.w3c.dom.*; +import org.xml.sax.InputSource; import helma.objectmodel.INode; import helma.objectmodel.db.DbKey; @@ -50,6 +52,20 @@ public class XmlReader implements XmlConstants { * read an InputStream with xml-content. */ public INode read (InputStream in, INode helmaNode) throws RuntimeException { + return read (new InputSource (in), helmaNode); + } + + /** + * read an character reader with xml-content. + */ + public INode read (Reader in, INode helmaNode) throws RuntimeException { + return read (new InputSource (in), helmaNode); + } + + /** + * read an InputSource with xml-content. + */ + public INode read (InputSource in, INode helmaNode) throws RuntimeException { if (helmaNode==null && nmgr==null) throw new RuntimeException ("can't create a new Node without a NodeManager"); Document document = XmlUtil.parse (in);