Random photo
Loading...
Domains for sale
|
November 29, 2004Why is XML case-sensitive?Sriram Krishnan asks strange question: I see someone flaming someone else for not being XHTML compliant. Tim Bray - if you're reading this, I want to know something. Why is XML case-sensitive? No human-being ever thinks in case-sensitive terms. A is a. End of story. So now, I have a situation where writing <html> </HTML> wouldn't be XHTML compliant. And what do I get out of XHTML apart from geek-bragging rights and this strange idea of 'standards-compliance'? Does it give me more freedom? Does it help my viewers? My customers?Well, this guy is definitely heavily sloppy-HTML-contaminated. What? <html> </HTML> isn't XHTML complaint? Thanks GOD! Anyway, Tim Bray does answer his question: XML markup is case-sensitive because the cost of monocasing in Unicode is horrible, horrible, horrible. Go look at the source code in your local java or .Net library.Nice. November 29, 2004 1:40 PM
| #XML
Comments
XML tags, etc have no requirement to be english. That means that a tag such as MyTAG and Mytag are as different to any OS as MyTAG and My123 or My_1_. A-Z and a-z are 26 completely unique numerical values in the system. At the turn of the 19th century, when ASIIC was defined, after IBM's EBCDIC format, some Genious realized it would be beneficial to Map A-Z and a-z, with just a single bit difference to map these 'special' characters from upper to lower and visa versa. This feature was purely for performance, since bit masking is a single clock in all hardware. The good people on the Unicode committee, although I'm sure they tried, failed to incorporate such an efficiency. Since massive amounts of data processing now incorporates XML, performance is very important. Unicode is incapable of making this mapping in a single clock. Seperate from that, being case insensitive is simply a form of laziness, and or lack of discipline. Greg XML case sensitivity any thing to do with Well, not *all* Ant users like it. Personally, I think case insensitivity is a plague that makes code more complicated everywhere it appears. (Instead of being able to simply compare strings, you now have to know to do a case-insensitive compare). I'd rather that Ant made a clear decision (e.g. lowercase only for everything) rather than allowing users this "flexibility" to have their Ant scripts look different from those in the next cubicle, for no good reason. Interesting point. Ant is case insensitive on all attributes, because users like it, but we remain case sensitive on element names because the XML parser refuses to match up element ends with element starts if they dont match properly. Posted by: Steve Loughran at November 30, 2004 12:10 PMPost a comment
|