Hey Angrez
I
sorted my problem. View src in ie dosen't reveal the true src of what is in the
DOM. Using web accesibility toolbar plugin in ie -> source -> view
generated source. I found the src of my div=test tag which wasn't
showing up in the standard ie view src. had one of the developers change
this to div id=test and now it's parsing ok.
Marco
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Angrez Singh
Sent: Monday, 5 June 2006 22:39
To: [email protected]
Subject: Re: [Wtr-general] xpath - which html checker to use?
Could you please send the HTML source so that we can have more detalied look into it?
Regards,
Angrez
On 6/5/06, Marco Neri
< [EMAIL PROTECTED]>
wrote:
I'm using watir 1.5.1.1017rexml 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.rbhtmlSource ="<?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?thanksMarco
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
=======================================================
The information contained in this email and any files attached may
be confidential information to the intended recipient and may be
the subject of legal professional privilege or public interest immunity.
If you are not the intended recipient, any use, disclosure or copying is
unauthorised.
If you have received this document in error please telephone 1300 307 082
*******************************************************************
This footnote also confirms that this email message has been swept
for the presence of computer viruses.
*******************************************************************
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
