XML区分大小写吗? [英] Is XML case-sensitive?
本文介绍了XML区分大小写吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
简短问题
XML是否区分大小写?
Is XML case-sensitive?
更长的问题
例如:
<Shirt color="Red"/>
属性颜色为 string
类型,可能包含一组有效颜色(红色
,蓝色
和绿色
)。
The attribute color is of type string
that may contain a set of valid colors (Red
, Blue
and Green
).
为了验证XML,我使用了以下XSD:
To validate the XML, I used the following XSD:
<xs:simpleType name="ColorType">
<xs:restriction base="xs:string">
<xs:enumeration value="Red"/>
<xs:enumeration value="Blue"/>
<xs:enumeration value="Green"/>
</xs:restriction>
</xs:simpleType>
我预期接受红色,蓝色和绿色的不同大小写形式吗?还是XML被认为是区分大小写的?
Am I expected to accept different case variations of Red, Blue and Green? Or XML is widely accepted as case-sensitive?
推荐答案
简短回答:
是-XML区分大小写。
Yes - XML is case sensitive.
更长的答案:
它被广泛认为是区分大小写的,但是,如果您想更灵活地接受,请看下面的问题,其中讨论了不区分大小写的枚举:
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区分大小写吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文