maiyude
新新人类
帖子
29
精华
0
无忧币 179
积分 79
阅读权限 20
|
发表于:2008-3-16 13:16
标题:substitutionGroup 的疑问
<上一帖 |
下一帖>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="writer" type="xsd:string" substitutionGroup="author" />
<xsd:element name="author" type="xsd:string" /> <!--这里的xsd:string能否改成xsd:integer? 改了以后和上面一句配合啥意思?-->
<xsd:element name="book">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="author" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:schema>
<!-- 感谢大侠的指点-->
我还有疑问:
那么在下面的对应上面的xml文件里面,author元素的内容按上面 substitutionGroup 所指可以是string,而按 <xsd:element name="author" type="xsd:integer" /> ,又可以是integer么?
<?xml version="1.0">
<book>
<author> 123 </author> <!--这里123是看作字符串呢,还是看作数字呢?-->
</book>
还有一个问题 <xsd:element ref="author" /> 里面的/> 表示啥意思?
|
 51cto三周年庆典 社区系列活动(购物卡、无忧币大派送!) |
|