以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 DTD/XML Schema 』  (http://bbs.xml.org.cn/list.asp?boardid=23)
----  [求助]Schema中想限定油箱的格式,应该怎样写正则表达式限定?  (http://bbs.xml.org.cn/dispbbs.asp?boardid=23&rootid=&id=69027)


--  作者:encienqi
--  发布时间:11/3/2008 7:13:00 PM

--  [求助]Schema中想限定油箱的格式,应该怎样写正则表达式限定?
[求助]Schema中想限定油箱的格式,应该怎样写正则表达式限定?
--  作者:wb1125
--  发布时间:1/4/2009 5:46:00 PM

--  
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
 <xs:element name="Person">
  <xs:complexType>
   <xs:sequence>
    <xs:element name="name"></xs:element>
    <xs:element name="email">
     <xs:simpleType>
      <xs:restriction base="xs:string">
       <xs:pattern value="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></xs:pattern>
      </xs:restriction>
     </xs:simpleType>
    </xs:element>
   </xs:sequence>
  </xs:complexType>
 </xs:element>
</xs:schema>
W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
31.250ms