This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 873 - XML validation of javascript decrement variable by 1 using --
Summary: XML validation of javascript decrement variable by 1 using --
Status: RESOLVED INVALID
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: 0.7.0
Hardware: Other other
: P2 trivial
Target Milestone: ---
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL: http://e-cycling.szm.sk
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-07 12:03 UTC by michal.szalai
Modified: 2004-09-07 12:24 UTC (History)
0 users

See Also:


Attachments

Description michal.szalai 2004-09-07 12:03:09 UTC
Hi. I wanted to use on my page:

<script type="text/javascript">
<!--
    var index = 10;
    index--;
//-->
</script>

From SGML parser I got this error on line where index-- is:
invalid comment declaration: found character ";" outside comment but inside 
comment declaration

Of course I can use index=index-1; or index-=1; but I like to use index--;
Comment 1 Bj 2004-09-07 12:24:53 UTC
You cannot do that, comments in XML documents must not include "--". Please 
also see http://www.w3.org/TR/xhtml1/#C_4 you cannot use <!-- ... --> in 
<script> elements in XHTML documents at all, user agents must ignore the 
content of <!-- ... --> so your scripts won't work when the document is 
processed as XML.