本站首页    管理页面    写新日志    退出


«Mar.2026»
1234567
891011121314
15161718192021
22232425262728
293031


公告
暂无公告...

我的分类(专题)

日志更新

最新评论

留言板

链接


Blog信息
blog名称:
日志总数:15
评论数量:4
留言数量:0
访问次数:46133
建立时间:2005年4月21日




[收藏] -- 作者:teiki
文章收藏

xyin2005 发表于 2005/4/21 10:03:13

本文转载自W3CHINA.ORG讨论区(BBS.W3CHINA.ORG)   原文链接作者:teiki以下为原文:上面的属性我们定义我们还可以采用属性组的办法来重新改写Schema文档。 order3.xsd----------------1: <xsd:element name="orderItem">2: <xsd:complexType>3: <xsd:sequence></xsd:sequence>4: <xsd:attributeGroup ref="orderItemAttributes"/>5: </xsd:complexType>6: </xsd:element>7:8: <xsd:attributeGroup name="orderItemAttributes">9: <xsd:attribute name="id" type="idType" use="required"/>10: <xsd:attribute name="quantity" type="xsd:integer" default="1"/>11: </xsd:attributeGroup> 这个属性组就不详细解释了,不过,大家一看就清楚了吧。 最后,我们写一个完整的订书order.xml的Schema文档。1: <?xml version="1.0"?>2: <xsd:schema xmlns:xsd="' target=_blank>http://www.w3.org/2001/XMLSchema">3:4: <xsd:element name="order">5: <xsd:complexType>6: <xsd:sequence>7: <xsd:element ref="orderItem" maxOccurs="10"/>8: </xsd:sequence>9: </xsd:complexType>10: </xsd:element>11:12: <xsd:element name="orderItem">13: <xsd:complexType>14: <xsd:sequence></xsd:sequence>15: <xsd:attributeGroup ref="orderItemAttributes"/>16: </xsd:complexType>17: </xsd:element>18:19: <xsd:attributeGroup name="orderItemAttributes">20: <xsd:attribute name="id" type="idType" use="required"/>21: <xsd:attribute name="quantity" type="xsd:integer" default="1"/>22: </xsd:attributeGroup>23:24: <xsd:simpleType name="idType">25: <xsd:restriction base="xsd:string">26: <xsd:pattern value="\d{1}-\d{4}-\d{4}-\d{1}"/>27: </xsd:restriction>28: </xsd:simpleType>29:30: </xsd:schema><完>参与讨论本主题


阅读全文(1453) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.438 second(s), page refreshed 144835780 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号