From: Espen Falkevik Date: 2005-06-17T17:15:19+09:00 Subject: Watir , REXML, Hi I looked at this project, but I can't seem to find the examples/code that can help me... Can anyone tell me how to fetch the HTML code and convert it into a REXML document? -Espen- --- James Britt wrote: > Espen Falkevik wrote: > > ... > > # open another browser and get's the xml-file > > ie2 = > > > Watir::IE.start("http://10.47.11.217/getxml?location=/Configuration/Audio/Outputs/Headset/Level") > > doc = ie2.document() > > > What sort of object are you expecting ie2.document() > to return? > > The call to XPath.first expects a REXML Document > object; the WATIR docs > really don't say much on this (it only says that > document() returns the > current document. ) > > But grepping the WATIR source code does not show any > references to > REXML, so it appears you'll need to first convert > the IE document or > content to a REXML Document object. > > Calling ie2.html gets you the DOM rendering of the > document HTML; it's > *not* the same as the HTML sent to the browser. If > it is not already > XML (and imagine it is not) you'll need to fix it > up. Take a look at > Michael Neumann's Mechanize library for some ways to > do this. His code > fetches HTML pages and exposes the content via a > nice API over an REXML > document. > > http://rubyforge.org/projects/wee > > > > James > -- > > http://www.ruby-doc.org - The Ruby Documentation > Site > http://www.rubyxml.com - News, Articles, and > Listings for Ruby & XML > http://www.rubystuff.com - The Ruby Store for Ruby > Stuff > http://www.jamesbritt.com - Playing with Better > Toys > > ___________________________________________________________ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com ___________________________________________________________ How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com