From: Marc G. <mgu...@ya...> - 2005-03-25 12:52:37
|
Hi Denis, I now think that htmlunit should resolve the entities as it does and that it would be wrong to have the entity code "as it". My motivation comes from the comparison with browsers: except view source, which is comparable to WebResponse.getContentAsString(), the different methods to access the source show the resolved entity: in js innerHTML or innerText (for IE) and View selection source (for Mozilla). Therefore I think that htmlunit behaves like browsers, what is correct, and that we should handle it only in webtest. Marc. Denis N. Antonioli wrote: > Hi > > I'm using htmlunit through webtest (<http://webtest.canoo.com>, for > those that don't know it). > In the present case, Webtest lets htmlunit generate a dom of an html > page before querying the document with xpath. > For example <verifyxpath xpath="/html/body/h2" text="Resultate"/> makes > sure that a h2 header displays the text 'Resultate'. > > I have the problem that, at some time, the text I want webtest to verify > is using html entities: > <verifyxpath xpath="/html/body/h2" text="Resultate f&uuml;r das Team > 33"/> > > With the help of Marc, I've found that htmlunit is always generating a > dom where all entities have been resolved. > > nekohtml seems to provide a feature > (http://apache.org/xml/features/scanner/notify-builtin-refs) to tell > when/where the > source contains entities (see description at > <http://cvs.apache.org/~andyc/neko/doc/html/settings.html#notify- > builtin-html-refs>). > > Does someone know if it is possible to get a dom tree in which the text > nodes contain entitites instead of characters? > > Does it make sense? > > Was it already tried? > > Would it be difficult? > > dna > |