以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  [求助]substitutionGroup 的疑问  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=60015)


--  作者:maiyude
--  发布时间:3/15/2008 8:29:00 PM

--  [求助]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" /> 里面的/> 表示啥意思?


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms