|
I'm using watir 1.5.1.1017
rexml 3.1.4 ( I have not copied any files out of
this distrubution )
I'm trying to use an xpath query in a
test and I'm running into a parse error ( here's incomplete trace
).
1) Error: test_rexmltest(TC_rexmltest): REXML::ParseException: #<REXML::ParseException: malformed XML: missing tag start Line: Position: Last 80 unconsumed characters: <div="test" /><div id="_xpbar10" style="BORDER-RIGHT: white 2px solid; BORDER-TO> E:/ruby/lib/ruby/site_ruby/1.8/rexml/parsers/baseparser.rb:338:in `pull' E:/ruby/lib/ruby/site_ruby/1.8/rexml/parsers/treeparser.rb:21:in `parse' E:/ruby/lib/ruby/site_ruby/1.8/rexml/document.rb:190:in `build' E:/ruby/lib/ruby/site_ruby/1.8/rexml/document.rb:45:in `initialize' E:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1017/./watir.rb:1858:in `new' ( note line number is out as I added in some puts calls into watir.rb to see what was going on ) The problem for me is I don't know why the div="test" has been included in
the output of the call to html_source(document.body,htmlSource," ") in function
create_rexml_document_object in watir.rb
htmlSource ="<?xml
version=\"1.0\"
encoding=\"us-ascii\"?>\n<HTML>\n"
htmlSource = html_source(document.body,htmlSource," ") htmlSource += "\n</HTML>\n" My problem has 2 parts.
1. why is div="test" written into the output yet when I check the
original src in the browser there is no tag div="test".
2. If I modify the watir.rb src and bypass the call to
(document.body,htmlSource," ") by using a diff call
(ie.ie.parent.document.body OR i use a filestream to read in a saved copy
of the html src for the page ) I don't have the div="test' error but I
still end up with other parse errors. I know these must be down to malformed
html. but..
when I run the original src html through either HTML tidy or Simpletidy it
reports warnings but not errors. The parser in rexml must be more
strict? Which validator should I use to independently verify the
html so that it's inline with what rexml parser expects?
thanks
Marco
|
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
