This Question is Answered

1 "helpful" answer available (2 pts)
4 Replies Last post: Dec 9, 2013 10:28 PM by simhamed  
simhamed Newbie 3 posts since
Dec 5, 2013
Currently Being Moderated

Dec 9, 2013 9:42 PM

[RubyMine 6] "Unescaped xml character" (using '<' characters with Doctype)

Hi everyone,

 

I was testing a javascript on a view on a RubyMine 4.5 project, and when I tried to add it on my working RubyMine 6 project, I've got an error.

 

Here's a part of the view :

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<script type="text/javascript">

     window.onload = function() {

          var elements = document.getElementsByTagName("tbody");
          for(var i=0; i<elements.length; i++)
          {

...

 

I've got an error (yes, in red, not just a warning) on the "<" character saying :

 

Unescaped xml character

This inspection checks that the script tag content is valid XML

 

And it's the same error for all the "<" I'm using in my for loops.

I don't know how to get ride of this problem, specially that it worked just fine on RubyMine 4 (with the same file headers and everything, it was just a copy/past of the javascript function).

Can anyone help me please? Thank you.

 

PS: Btw the javascript function works just fine when running, it's just that I've got a bunch of red errors in the view page, but it doesn't affect the running.

Oleg Sukhodolsky JetBrains 867 posts since
Apr 4, 2012
Currently Being Moderated
Dec 6, 2013 10:06 AM in response to: simhamed
Re: [RubyMine 6] "Unescaped xml character"

I think the problem is that you use strict xhtml doctype, if you think that it is ok to have such characters in your html then you should use some other doctype.

 

Oleg.

Oleg Sukhodolsky JetBrains 867 posts since
Apr 4, 2012
Currently Being Moderated
Dec 9, 2013 10:03 PM in response to: simhamed
Re: [RubyMine 6] "Unescaped xml character"

Hi,

 

I'm not sure I've completely understood you reply

 

At first you say that html5 doctype resolves the problem, but later you say that no doctype resolves the problem.

Do you mean that original problem has been fixed by html5 doctype, but even html5 doesn't solve problem you have with erb injection?

Perhaps screenshot or a short screencast would be useful here.

 

Regards, Oleg.

More Like This

  • Retrieving data ...