summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org/madore/damlengine/DamlEngine.java12
-rw-r--r--org/madore/damlengine/WeblogIndexSelect.java3
-rw-r--r--org/madore/damlengine/WeblogSelect.java3
3 files changed, 11 insertions, 7 deletions
diff --git a/org/madore/damlengine/DamlEngine.java b/org/madore/damlengine/DamlEngine.java
index 6581f37..070cbab 100644
--- a/org/madore/damlengine/DamlEngine.java
+++ b/org/madore/damlengine/DamlEngine.java
@@ -1,5 +1,7 @@
package org.madore.damlengine;
+import java.io.InputStream;
+import java.io.FileInputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import javax.xml.XMLConstants;
@@ -87,13 +89,13 @@ public final class DamlEngine {
processDocument(doc, null);
}
- public static void fullProcess(String fname, OutputStream out,
+ public static void fullProcess(InputStream in, OutputStream out,
Context.WeblogSelectionContext wsc)
throws Exception {
final DocumentBuilder db = GetDocumentBuilder.db;
- Document doc = db.parse(fname);
+ Document doc = db.parse(in);
processDocument(doc, wsc);
doc.normalizeDocument();
Unparser unparser
@@ -103,9 +105,9 @@ public final class DamlEngine {
}
- public static void fullProcess(String fname, OutputStream out)
+ public static void fullProcess(InputStream in, OutputStream out)
throws Exception {
- fullProcess(fname, out, null);
+ fullProcess(in, out, null);
}
public static void main(String[] args)
@@ -116,7 +118,7 @@ public final class DamlEngine {
}
for (String fname : args) {
- fullProcess (fname, System.out);
+ fullProcess (new FileInputStream(fname), System.out);
}
}
diff --git a/org/madore/damlengine/WeblogIndexSelect.java b/org/madore/damlengine/WeblogIndexSelect.java
index 5d6bc53..c9bf617 100644
--- a/org/madore/damlengine/WeblogIndexSelect.java
+++ b/org/madore/damlengine/WeblogIndexSelect.java
@@ -9,7 +9,8 @@ public final class WeblogIndexSelect {
public static void main(String[] args)
throws Exception {
- DamlEngine.fullProcess("weblog-index-template.daml", System.out, null);
+ DamlEngine.fullProcess(DamlEngine.class.getResourceAsStream("weblog-index-template.daml"),
+ System.out, null);
}
diff --git a/org/madore/damlengine/WeblogSelect.java b/org/madore/damlengine/WeblogSelect.java
index ad61cbc..cb263e6 100644
--- a/org/madore/damlengine/WeblogSelect.java
+++ b/org/madore/damlengine/WeblogSelect.java
@@ -36,7 +36,8 @@ public final class WeblogSelect {
wsc.xmlData.add(content);
}
- DamlEngine.fullProcess("weblog-month-template.daml", System.out, wsc);
+ DamlEngine.fullProcess(DamlEngine.class.getResourceAsStream("weblog-month-template.daml"),
+ System.out, wsc);
}