日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

一个完整的schema验证xml的样例

發(fā)布時間:2025/7/14 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 一个完整的schema验证xml的样例 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
xml文件:<reference xmlns="http://www.w3school.com.cn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3school.com.cn J.xsd"><author authorLoc="1">陳路瑤</author><title>信息文檔結(jié)構(gòu)信任模式的提取及邏輯描寫敘述</title><type>J</type><publisher>計算機(jī)應(yīng)用研究</publisher><publish_year>2010</publish_year><volumn_mark>27</volumn_mark><page_number>4624-4629</page_number> </reference>


schema文件(J.xsd):

<?xml version="1.0" encoding="GB2312"?

> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3school.com.cn" targetNamespace="http://www.w3school.com.cn" elementFormDefault="qualified"> <xs:element name="reference"> <xs:complexType> <xs:sequence> <xs:element name="author" type="authorInfo" minOccurs="1" maxOccurs="1"/> <xs:element name="title" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="publish" type="xs:string" minOccurs="0" maxOccurs="1"/> <xs:element name="publisher" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="publish_year" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="volumn_mark" type="xs:string" minOccurs="1" maxOccurs="1"/> <xs:element name="page_number" minOccurs="1" maxOccurs="1"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="(\d{1,4}-)?

\d{1,4}"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="authorInfo"> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="authorLoc" use="required"> <xs:simpleType> <xs:restriction base="xs:integer"> <xs:enumeration value="1"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:schema>




轉(zhuǎn)載于:https://www.cnblogs.com/jzdwajue/p/7112884.html

總結(jié)

以上是生活随笔為你收集整理的一个完整的schema验证xml的样例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。