以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  schema嵌入schematron失效  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=54067)


--  作者:danielhy
--  发布时间:10/19/2007 10:59:00 AM

--  schema嵌入schematron失效
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://www.ascc.net/xml/schematron">
 <xs:element name="emails">
  <xs:complexType>
   <xs:sequence>
    <xs:element name="email"  maxOccurs="unbounded">
     <xs:annotation>
      <xs:appinfo>
       <sch:pattern name="Check address">
        <sch:rule context="email">
         <sch:assert test="contains(.,'@')"> @ is missing in an email</sch:assert>
        </sch:rule>
       </sch:pattern>
      </xs:appinfo>
     </xs:annotation>
    </xs:element>
   </xs:sequence>
  </xs:complexType>
 </xs:element>
</xs:schema>
为什么不起作用呢,郁闷了很久

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