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 5196 - validator is trying to parse javascript strings for xhtml tags
Summary: validator is trying to parse javascript strings for xhtml tags
Status: RESOLVED INVALID
Alias: None
Product: Validator
Classification: Unclassified
Component: Parser (show other bugs)
Version: 0.8.2
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL: http://validator.w3.org/#validate_by_...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-15 02:05 UTC by Michael Lee
Modified: 2007-10-15 04:41 UTC (History)
0 users

See Also:


Attachments

Description Michael Lee 2007-10-15 02:05:25 UTC
It appears that the parser is trying to parse possible elements within JavaScript code.

I believe the following xhtml is incorrectly marked as invalid:

---------snip-----------
<!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>

    <title>Break Validator</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    
</head><body><script type='text/javascript'>

var a = '<br/>';

</script></body></html>
---------snip-----------

The JavaScript variable assignment statement contains a string that coincidentally resembles an xhtml element.  The validator is parsing the text as if it contains an element in the document and then marking the element as not allowed in the current context.
Comment 1 Olivier Thereaux 2007-10-15 04:41:49 UTC
Hi Michael,

This is a FAQ. See:
http://validator.w3.org/docs/help.html#faq-javascript