Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is XML case-sensitive?

People also ask

Does case matter in XML?

All of an XML document is case-sensitive. This is significantly different from HTML and most other SGML applications, where the default was to ignore case. It was done to allow markup in non-Latin-alphabet languages, and to obviate problems with case-folding in writing systems which are inherently caseless.

Is XML and HTML case sensitive?

HTML is not Case sensitive. XML is Case sensitive.

Does XML have to be lowercase?

The original intent for XML casing was lower case with hyphens. It's case sensitive and doesn't require you follow that convention -- so you can do whatever you want.

Is XML capitalized?

Uppercase Keywords In general, the keywords that relate to DTDs (e.g., DOCTYPE, ENTITY, CDATA, ELEMENT, ATTLIST, PCDATA, IMPLIED, REQUIRED, and FIXED) must be all uppercase. On the other hand, the various strings used in the XML declaration (e.g., xml, version, standalone, and encoding) must appear in all lowercase.


Short Answer:

Yes - XML is case sensitive.

Longer Answer:

It is widely accepted as case sensitive, however if you want to accept more flexibly, take a look at the question below, which discusses having case-insensitive enumerations:

XML Schema Case Insensitive Enumeration of Simple Type String


With XSD 1.1 you can achieve a case-insensitive enumeration using an assertion:

<xs:simpleType name="RGB">
  <xs:restriction base="xs:string">
    <xs:assert test="lower-case($value) = ('red', 'green', 'blue')"/>
  </xs:restriction>
</xs:simpleType>

XSD 1.1 is supported in recent releases of Saxon and Xerces.