Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343189 - Attribute case modified for XHTML documents
Summary: Attribute case modified for XHTML documents
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.html (show other bugs)
Version: 3.2.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.4   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nick Sandonato CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-18 14:18 EDT by Nick Sandonato CLA
Modified: 2011-04-21 10:27 EDT (History)
2 users (show)

See Also:
david_williams: pmc_approved+
nsand.dev: pmc_approved? (raghunathan.srinivasan)
nsand.dev: pmc_approved? (naci.dai)
nsand.dev: pmc_approved? (deboer)
nsand.dev: pmc_approved? (neil.hauge)
nsand.dev: pmc_approved? (kaloyan)
nsand.dev: pmc_approved? (cbridgha)
thatnitind: review+


Attachments
patch (893 bytes, patch)
2011-04-18 14:26 EDT, Nick Sandonato CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Sandonato CLA 2011-04-18 14:18:10 EDT
When adding nodes to XHTML documents, the XMLGenerator is modifying the tag and attribute case forcing lowercase. This can be problematic for attributes that are camel-cased, often resulting in validation messages like "Attribute name () uses wrong case character."
Comment 1 Nick Sandonato CLA 2011-04-18 14:26:30 EDT
Created attachment 193515 [details]
patch

For XHTML documents, we should be following the case suggestions of the XML version of the DocumentTypeAdapter instead of forcing lower for attribute values.
Comment 2 Nick Sandonato CLA 2011-04-18 15:50:08 EDT
*Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such.

Causes nodes inserted via the DOM to possibly fail validation against strict XML case requirements.

* Is there a work-around? If so, why do you believe the work-around is insufficient?

No

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added?

Existing unit tests run. Ad hoc testing.

* Give a brief technical overview. Who has reviewed this fix?

For XHTML documents, the code was incorrectly dictating that because it was an XML-type document, lowercase attribute names should be generated always. Instead, a strict adherence to the existing case should be used as dictated by the super class.

Nitin has reviewed the fix.

* What is the risk associated with this fix?

Fairly low.
Comment 3 David Williams CLA 2011-04-18 21:38:00 EDT
I think this is a fine fix, and appears simple and safe enough. But, you'd have a stronger case if you documented some examples; some cases where this causes problems. I think that the "HTML" variants of XHTML do use all lower case attributes, right? Or, am I missing some? I'd guess, and is what I'm asking you to document, that mixed case examples come from other families ... such as "XHTML plus Math 1.1 DTD"? I just want to make sure the likelyhood of hitting this problem is understood, and that you've seen this problem with "real life" cases. 

Thanks,
Comment 4 Nick Sandonato CLA 2011-04-19 10:42:50 EDT
The problem comes from an adopter. They've contributed attributes through Model Query Extension that have mixed case. As such, when validating the XHTML document, the case is found to be different from what was contributed to the content model. This could be avoided by making sure that the case of attributes is not modified for XHTML documents when using the DOM to add nodes.
Comment 5 David Williams CLA 2011-04-19 10:55:26 EDT
(In reply to comment #4)
> The problem comes from an adopter. ...

Well, you've got me curious now! :) ... but, does sound like "real life", so I'm fine with this.
Comment 6 Nick Sandonato CLA 2011-04-19 11:54:13 EDT
Thanks, David.  I'm glad your curiosity has been piqued.
Comment 7 Nick Sandonato CLA 2011-04-19 11:54:30 EDT
Code checked in.