Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > REXML bombs out in a javascript section of a well formed XHTML document

Reply
Thread Tools

REXML bombs out in a javascript section of a well formed XHTML document

 
 
Xeno Campanoli
Guest
Posts: n/a
 
      07-01-2005
As far as I can see, this javascript should just be text for the XML parser,
n'est-ce pas? But I bomb out several lines into it with:

Illegal character '&' in raw string (referring to a javascript and (&&) operator
presumably. So, do we need to preparse the javascript out or something to be
able to do this stuff? What gives with that?

xc


 
Reply With Quote
 
 
 
 
James Britt
Guest
Posts: n/a
 
      07-01-2005
Xeno Campanoli wrote:
> As far as I can see, this javascript should just be text for the XML parser,
> n'est-ce pas? But I bomb out several lines into it with:


"this javascript" did not make it to my mail reader; did you include it?
>
> Illegal character '&' in raw string (referring to a javascript and (&&) operator
> presumably. So, do we need to preparse the javascript out or something to be
> able to do this stuff? What gives with that?


Unless you are hiding the script element content with XML comment markup
or wrapping it in CDATA markup, then it is interpreted as normal XML
fodder, and the ampersand has a special meaning.

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


 
Reply With Quote
 
 
 
 
Phrogz
Guest
Posts: n/a
 
      07-01-2005
James Britt wrote:
> Unless you are hiding the script element content with XML comment markup
> or wrapping it in CDATA markup, then it is interpreted as normal XML
> fodder, and the ampersand has a special meaning.


To elaborate by example:

<?xml version="1.0"?>
<foo><script>if (a && b || 5 < 6) alert("Hi!")</script></foo>
^---------^-------- ILLEGAL CHARACTERS

<?xml version="1.0"?>
<foo><script><![CDATA[if (a && b || 5 < 6)
alert("Hi!")]]></script></foo>
LEGAL!


<?xml version="1.0"?>
<foo><script>if (a &amp;&amp; b || 5 &lt; 6)
alert("Hi!")</script></foo>
LEGAL!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP code bombs out after SQL retrieve with over thousands of records LetMeDoIt ASP General 3 05-21-2007 03:21 PM
DataList Creates Tables That Are Not Well-Formed Nathan Sokalski ASP .Net 0 11-30-2005 06:08 AM
The server tag is not well formed mike ASP .Net 3 11-24-2005 08:03 PM
Parser Error: The server block is not well formed Assimalyst ASP .Net 4 07-25-2005 03:16 PM
XSLT created UserControl gives 'not well formed' error wtsnet ASP .Net 4 11-25-2003 02:53 PM



Advertisments