deweese 2002/07/23 18:19:31
Modified: sources/org/apache/batik/bridge ScriptingEnvironment.java
sources/org/apache/batik/dom/util SAXDocumentFactory.java
Log:
Added Addional versions of createDocument. parseXML uses these to avoid
having to say what the root element will be.
Revision Changes Path
1.34 +2 -3
xml-batik/sources/org/apache/batik/bridge/ScriptingEnvironment.java
Index: ScriptingEnvironment.java
===================================================================
RCS file:
/home/cvs/xml-batik/sources/org/apache/batik/bridge/ScriptingEnvironment.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- ScriptingEnvironment.java 24 Jul 2002 00:02:27 -0000 1.33
+++ ScriptingEnvironment.java 24 Jul 2002 01:19:31 -0000 1.34
@@ -721,8 +721,7 @@
XMLResourceDescriptor.getXMLParserClassName());
try {
Document d = sdf.createDocument
- ("http://example.org/Foo", "foo",
- uri, new StringReader(text));
+ (uri, new StringReader(text));
result = doc.createDocumentFragment();
result.appendChild(doc.importNode(d.getDocumentElement(),
true));
} catch (Exception ext) {
1.13 +36 -1
xml-batik/sources/org/apache/batik/dom/util/SAXDocumentFactory.java
Index: SAXDocumentFactory.java
===================================================================
RCS file:
/home/cvs/xml-batik/sources/org/apache/batik/dom/util/SAXDocumentFactory.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- SAXDocumentFactory.java 24 Jul 2002 00:02:28 -0000 1.12
+++ SAXDocumentFactory.java 24 Jul 2002 01:19:31 -0000 1.13
@@ -199,6 +199,16 @@
/**
* Creates a Document instance.
+ * @param uri The document URI.
+ * @exception IOException if an error occured while reading the document.
+ */
+ public Document createDocument(String uri)
+ throws IOException {
+ return createDocument(new InputSource(uri));
+ }
+
+ /**
+ * Creates a Document instance.
* @param ns The namespace URI of the root element of the document.
* @param root The name of the root element of the document.
* @param uri The document URI.
@@ -214,6 +224,19 @@
/**
* Creates a Document instance.
+ * @param uri The document URI.
+ * @param is The document input stream.
+ * @exception IOException if an error occured while reading the document.
+ */
+ public Document createDocument(String uri, InputStream is)
+ throws IOException {
+ InputSource inp = new InputSource(is);
+ inp.setSystemId(uri);
+ return createDocument(inp);
+ }
+
+ /**
+ * Creates a Document instance.
* @param ns The namespace URI of the root element of the document.
* @param root The name of the root element of the document.
* @param uri The document URI.
@@ -225,6 +248,18 @@
InputSource inp = new InputSource(r);
inp.setSystemId(uri);
return createDocument(ns, root, uri, inp);
+ }
+
+ /**
+ * Creates a Document instance.
+ * @param uri The document URI.
+ * @param r The document reader.
+ * @exception IOException if an error occured while reading the document.
+ */
+ public Document createDocument(String uri, Reader r) throws IOException {
+ InputSource inp = new InputSource(r);
+ inp.setSystemId(uri);
+ return createDocument(inp);
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]