依照以下条件写出合适的XML Schema.

前端之家收集整理的这篇文章主要介绍了依照以下条件写出合适的XML Schema.前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

依照以下条件写出合适的XML Schema.@H_403_2@

(1)父元素为Motorcycle.@H_403_2@

(2)@H_403_2@元素有一个属性名称为motorid,类型为正整数,且一定要输入.

(3)一个Brand子元素,类型为字符串,记录摩托车品牌.

(4)一个Date子元素,类型为日期,记录购买日期.

(5)一个Owner子元素,类型为字符串,记录摩托车所有人姓名.

Reg:

motorcycle.xml 
----------- 
<motorcycle motorid="10"> 
<Brand>豪爵摩托</Brand> 
<Date>2014-12-25</Date> 
<Owner>罗嘉欣</Owner> 
</motorcycle> 


motorcycle.xsd 

<?xml version="1.0"?> 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 

<xsd:element name="motorcycle"> 
<xsd:complexType> 
<xsd:sequence> 
<xsd:element name="Brand" type="xsd:string" /> 
<xsd:element name="Data" type="xsd:data"/> 
<xsd:element name="Owner" type="xsd:string" /> 
</xsd:sequence> 
<!-- 增加属性定义 --> 
<xsd:attribute name="motorid" type="xsd:integer" use="required"/> 
</xsd:complexType> 
</xsd:element> 

</xsd:schema>
原文链接:https://www.f2er.com/xml/297477.html

猜你在找的XML相关文章