nikgoodley-ibboost / aost

Automatically exported from code.google.com/p/aost
0 stars 0 forks source link

Add support for get back xml document #129

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Sometimes, the response may be just xml document. Need to be able to get
back the xml source for parsing.

Original issue reported on code.google.com by John.Jian.Fang@gmail.com on 2 Mar 2009 at 10:45

GoogleCodeExporter commented 9 years ago
Added the following method in DslContext,

    public String getXMLDocument(){

      String script = """var doc = window.document;
        var xml = null;
        if(doc instanceof XMLDocument){
           xml = new XMLSerializer().serializeToString(doc);
        }else{
           xml = getText(doc.body);
        }
        xml; """

      String xml =  getEval(script)

      return xml
    }

Original comment by John.Jian.Fang@gmail.com on 3 Mar 2009 at 12:15