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


«April 2026»
1234
567891011
12131415161718
19202122232425
2627282930


公告
暂无公告...

我的分类(专题)

日志更新

最新评论

留言板

链接


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




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

xyin2005 发表于 2005/4/21 10:01:32

本文转载自W3CHINA.ORG讨论区(BBS.W3CHINA.ORG)   原文链接作者:teiki以下为原文:跟我学XML Schema(4):如何定义属性呢? 加入实例文档的元素包含属性,怎么办呢? customer2.xml---------------<customer id="001718"><name>Teiki</name><address>No.237, Road Waitan, Shanghai</address></customer> 那就这样写Schema文档:customer2.xsd------------------1: <?xml version="1.0"?>2: <xsd:schema xmlns:xsd="' target=_blank>http://www.w3.org/2001/XMLSchema">3:4: <xsd:element name="customer">5: <xsd:complexType>6: <xsd:sequence>7: <xsd:element name="name" type="xsd:string"/>8: <xsd:element name="address" type="xsd:string" />9: </xsd:sequence>10: <!-- 增加属性定义 -->11: <xsd:attribute name="id" type="xsd:string"/>12: </xsd:complexType>13: </xsd:element>14:15: </xsd:schema> 很简单,在<sequence>元素定义完成后,再用<attribute>元素id。<完>参与讨论本主题


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



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



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

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