how can i provide the functionality for document.write()

naveen edupuganti <[email protected]>
Newsgroups gmane.comp.web.httpunit.devel
Message-ID <[email protected]>
hai all 
    I need to evalute the javascript functions in the
htmlpage using the rhino. For this i am working with
httpunit part with evaluate expression. 
But i am getting the errors . Please help me out 
how to provide the functionlity for 
document.write();
I am trying this but nothing is getting adedd to
documnet
wc.getCurrentPage().getScriptableObject().evaluateExpression("document.write('this
is anoher node ')");

when i am trying to append a new text node to the dom
i am getting the error 

Exception: org.w3c.dom.DOMException:
WRONG_DOCUMENT_ERR: A node is used in a different
document than the one that created it.

here is the code fragment

 WebResponse response = wc.getResponse(
"http://localhost:8080/New/test.html");
String response1 =
response.getLinkWith("").getURLString();
 
  Document doc= wc.getCurrentPage().getDOM();
            
System.out.println(doc.getElementsByTagName("*").getLength());

wc.getCurrentPage().getDOM().appendChild(doc.createTextNode("hallo
world"));

how could i provide this functionality



		
__________________________________________________________ 
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.