...
language | en |
---|
The XSD files contain the schema definition of the data. They describe the attributes of each data element in an XML file—that is, what is acceptable for the user to type or select when editing the job info sheet.
The XSD file also constrains the data to standard types—for example, integer or string. This prevents errors such as entering text in a field that should only contain numbers.
For example, the following portion of an XSD file specifies that the values for the TotalQuantity data element must be strings:
<xs:element name="TotalQuantity" type="xs:string"/>
Another example is a turnaround time field, which creates a selectable list of three values
...
:
...
language | zh |
---|
XSD 文件包含数据的模式定义。 它们描述 XML 文件中每个数据元素的属性 — 即在编辑作业信息页时,哪些内容允许用户输入或选择。
XSD 文件还将数据限制为标准类型 — 例如,整数或字符串。 这可以阻止类似于在应只包含数字的字段中输入文本等错误。
例如,XSD 文件的以下部分指定 TotalQuantity 数据元素的值必须为字符串:
<xs:element name="TotalQuantity" type="xs:string"/>
...
<xs:element name="Turnaround">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="One Day"/>
<xs:enumeration value="Two Day"/>
<xs:enumeration value="One Week"/>
</xs:restriction>
</xs:simpleType>
</xs:element>