Embedded JS - DOM - Namespace issues
"Maruthi R Janardhan" <[email protected]>
| Newsgroups | gmane.comp.web.httpunit.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I have two issues on which I need help badly.
1) I was trying to obtain the DOM of a HTML by calling webResp.getDOM(). It
fails with a DOMException saying:
NAMESPACE_ERR: An attempt is made to create or change an object in a way
which is incorrect with regard to namespaces.
I later noticed that my HTML started off like this: <html
xmlns="http://www.w3.org/1999/xhtml">
If I take out the xmlns attribute, it loads the DOM just fine. I realized
this was a xerces issue. Is there a known workaround for this? (I am using
the latest Xerces 2.9, HTTPUnit 1.6.2 and JDK 1.5_09)
2) Is there a way to tell HTTPUnit to not get the embedded scripts (JS
files). I am not interested in the scripts. I only need the HTML as a DOM
for processing. Loading the scripts is taking time and sometimes fails the
entire webresponse loading.
I did not find anything on the lists or on google.
Pls help. Full stack trace for the first issue is below.
Thanks,
Maruthi
org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or
change an object in a way which is incorrect with regard to namespaces.
at org.apache.xerces.dom.AttrNSImpl.setName(Unknown Source)
at org.apache.xerces.dom.AttrNSImpl.<init>(Unknown Source)
at org.apache.xerces.dom.CoreDocumentImpl.createAttributeNS(Unknown
Source)
at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
at org.apache.xerces.dom.CoreDocumentImpl.cloneNode(Unknown Source)
at org.apache.html.dom.HTMLDocumentImpl.cloneNode(Unknown Source)
at com.meterware.httpunit.ParsedHTML.getDOM(ParsedHTML.java:975)
at com.meterware.httpunit.WebResponse.getDOM(WebResponse.java:538)
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Httpunit-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/httpunit-develop