Firefox:XMLDocument Case Sensitivity:Scratch Pad

From MozillaWiki
Jump to: navigation, search

DOM handling is very confusing if you have tags containing uppercase letters together with lowercase letters. This is due to the XHTML standard: XHTML is case sensitive, and since XHTML only accepts lower case HTML tags and attribute names, a general search and replace function was executed to replace all upper case tags with lowercase tags. But IE has ignored this aspect of XHTML standard by simply running all XML operations protecting the case-sensitivity. This is much more convenient since XML standard itself is case-sensitive.

Below are the conflicting behaviors of XML handling in Firefox:

1. All xhtml tags are converted into LOWERCASE because of XHTML compatibility

2. nodeName getter for Element object returns in UPPERCASE

3. XMLDocument object keeps the dom document by converting all tags to UPPERCASE

4. XMLSerializer.serializeToString returns all the tag names in UPPERCASE

Hence, writing robust codes that perform both serverside and client side XML operations is always difficult with this confliction case-INsensitive DOM handling. Coming versions must handle this issue by supporting case-sensitivity.