diff --git a/src/helma/scripting/rhino/extensions/XmlObject.java b/src/helma/scripting/rhino/extensions/XmlObject.java index aa6e054d..68d0b7cc 100644 --- a/src/helma/scripting/rhino/extensions/XmlObject.java +++ b/src/helma/scripting/rhino/extensions/XmlObject.java @@ -54,14 +54,8 @@ public class XmlObject { * @throws IOException ... * @throws RuntimeException ... */ - public boolean write(Object hopObject, String file) + public boolean write(INode node, String file) throws IOException { - INode node = null; - - if (hopObject instanceof HopObject) { - node = ((HopObject) hopObject).getNode(); - } - // we definitly need a node if (node == null) { throw new RuntimeException("First argument in Xml.write() is not an hopobject"); @@ -92,13 +86,7 @@ public class XmlObject { * Xml.create() is used to get a string containing the xml-content. * Useful if Xml-content should be made public through the web. */ - public String writeToString(Object hopObject) throws IOException { - INode node = null; - - if (hopObject instanceof HopObject) { - node = ((HopObject) hopObject).getNode(); - } - + public String writeToString(INode node) throws IOException { // we definitly need a node if (node == null) { throw new RuntimeException("First argument in Xml.write() is not an hopobject"); @@ -142,17 +130,11 @@ public class XmlObject { * * @throws RuntimeException ... */ - public Object read(String file, Object hopObject) throws RuntimeException { + public Object read(String file, INode node) throws RuntimeException { if (file == null) { throw new RuntimeException("Missing arguments in Xml.read()"); } - INode node = null; - - if (hopObject instanceof HopObject) { - node = ((HopObject) hopObject).getNode(); - } - if (node == null) { // make sure we have a node, even if 2nd arg doesn't exist or is not a node node = new Node((String) null, (String) null, @@ -194,18 +176,12 @@ public class XmlObject { * * @throws RuntimeException ... */ - public Object readFromString(String str, Object hopObject) + public Object readFromString(String str, INode node) throws RuntimeException { if (str == null) { throw new RuntimeException("Missing arguments in Xml.read()"); } - INode node = null; - - if (hopObject instanceof HopObject) { - node = ((HopObject) hopObject).getNode(); - } - if (node == null) { // make sure we have a node, even if 2nd arg doesn't exist or is not a node node = new Node((String) null, (String) null,