XML parser parses inside script and breaks on '<'

VERIFIED WONTFIX

Status

()

Core
DOM
P3
critical
VERIFIED WONTFIX
18 years ago
17 years ago

People

(Reporter: Mona M. Everett, Assigned: vidur (gone))

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

18 years ago
<bookstore xmlns:html="http://www.w3.org/TR/REC-html40">
booklist   
  <book genre="autobiography" name='firstbook'>
    book1
    <title>The Autobiography of Benjamin Franklin</title>
    <author>
      <first-name>Benjamin</first-name>
      <last-name>Franklin</last-name>
    </author>
    <price>8.99</price>
  </book>
  <book genre="novel">
  	book2
    <title>The Confidence Man</title>
    <author>
      <first-name>Herman</first-name>
      <last-name>Melville</last-name>
    </author>
    <price>11.99</price>
  </book>
  <book genre="philosophy">
    book3
    <title>The Gorgias</title>
    <author>
      <name>Plato</name>
    </author>
    <price>9.99</price>
  </book>
  <book genre="fiction">
    book4
    <title>The Black Rose</title>
    <author>
      <name>Costain</name>
    </author>
    <price>19.99</price>
  </book>
<html:script language="Javascript1.2">
	var x = 5
	var y = 2
	if ( x > y )
	{
	   alert(' x > y \n' + x + ' > ' + y )
	}
	if ( x < y )
	{
	 	
	   alert(' y > x \n' + y + ' > ' + x )
	}
	
	var ii, astr
	for ( ii == 0 ; ii < 5 ; ii++ )
	{
	 	astr += 'x'
	}
	
	alert(astr)
</html:script>
</bookstore>

----------------------------  Error Returned ---------------------------
XML Parsing Error: not well-formed
Line Number 48, Column 9

    if ( x < y )
(Arrow points to f in 'if' )
It always errors on the line with the '<'; you can switch the two if statements
to test this.
(Assignee)

Comment 1

18 years ago
That's correct behavior. The contents of the SCRIPT element have to either by 
enclosed in a CDATA section (http://www.w3.org/TR/REC-xml#sec-cdata-sect) or 
(ugh...) contain character entities instead of <, > and &.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → WONTFIX

Comment 2

18 years ago
verified
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.