Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316223

Summary: [parser] < or > in attribute values are not supported
Product: [WebTools] WTP Source Editing Reporter: Nick Sandonato <nsand.dev>
Component: jst.jspAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: David.Wagner, ruisj
Version: 3.0.5Flags: thatnitind: review+
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard: WI 49464
Attachments:
Description Flags
patch
none
unit test updates
none
tweaked patch
none
updated unit tests
none
updated unit tests none

Description Nick Sandonato CLA 2010-06-08 19:27:41 EDT
+++ This bug was initially created as a clone of Bug #316222 for the purposes of fixing in 3.2 +++

A < or > in an attribute value, while perfectly legal, causes the parser to function incorrectly.

Examples:
<button value=">>"></button>
<button value="<<"></button>

In the case of JSP, it's assumed that what follows is going to be an embedded tag. So, we'll need to work with both the XMLTokenizer and JSPTokenizer.
Comment 1 Nick Sandonato CLA 2010-06-08 19:31:08 EDT
Created attachment 171481 [details]
patch

Tokenizer updates.
Comment 2 Nick Sandonato CLA 2010-06-08 20:58:30 EDT
Created attachment 171484 [details]
unit test updates

Have to update some of the unit tests.
Comment 3 Nitin Dahyabhai CLA 2010-06-08 23:24:42 EDT
Are you sure about the XML changes?  I thought this should only apply to HTML and maybe JSP.
Comment 4 Nick Sandonato CLA 2010-06-09 10:36:29 EDT
(In reply to comment #3)
> Are you sure about the XML changes?  I thought this should only apply to HTML
> and maybe JSP.

While it does only apply to HTML and JSP, this does have some positives for XML. Instead of the tokenizer getting confused for a < or > in attribute values, it recovers and the attribute value region remains intact. The validator will then identify that the < or > is invalid in an XML.
Comment 5 Nick Sandonato CLA 2010-06-15 10:40:41 EDT
Created attachment 171936 [details]
tweaked patch

Removed the unnecessary assignment of 'fShouldLoadBuffered = true;'
Comment 6 Nick Sandonato CLA 2010-06-15 13:20:24 EDT
Created attachment 171965 [details]
updated unit tests

Had to fix up some of the HTML unit tests and added some new ones.
Comment 7 Nick Sandonato CLA 2010-06-15 13:26:20 EDT
Created attachment 171967 [details]
updated unit tests
Comment 8 Nick Sandonato CLA 2010-06-29 13:41:54 EDT
Code released to Maintenance and HEAD
Comment 9 Nick Sandonato CLA 2010-06-29 14:14:13 EDT
*** Bug 112807 has been marked as a duplicate of this bug. ***
Comment 10 Nick Sandonato CLA 2010-10-04 16:39:56 EDT
*** Bug 258676 has been marked as a duplicate of this bug. ***