问题描述
大师请看数据结构如下:父元素名称元素名称约束类型宽度data1struct—datadatas_info*struct—datas_infoname1string14datas_infonameid1string14datas_infosub_list*struct—sub_listbasic_id1string10sub_listmk_list*struct—mk_listmk_id1string50mk_listmk_name1date200我想把它写成一个xsd文件目的用于解析xml文件
解决方案
解决方案二:
解决方案三:
<?xmlversion="1.0"encoding="UTF-8"?><xsd:schemaxmlns:xsd="http://www.w3.org/2001/XMLSchema"targetNamespace="http://www.i99tv.com/base/configuration"elementFormDefault="qualified"><xsd:elementname="configuration"><xsd:complexType><xsd:sequence><xsd:elementname="id"type="xsd:integer"/><xsd:elementname="name"type="xsd:string"/><xsd:elementname="homepage"type="xsd:string"/><xsd:elementname="description"type="xsd:string"/><xsd:elementname="class"type="xsd:string"/><xsd:elementname="serie"><xsd:complexType><xsd:choice><xsd:elementname="link"minOccurs="1"maxOccurs="unbounded"><xsd:complexType><xsd:attributename="type"type="xsd:string"use="required"/><xsd:attributename="value"type="xsd:string"use="required"/></xsd:complexType></xsd:element></xsd:choice></xsd:complexType></xsd:element><xsd:elementname="episode"><xsd:annotation><xsd:documentation><![CDATA[type="in"则直接使用指定的属性为详细页地址<br/>type="out"必须要设置link,而且还要根据link获取详细内容的参数进行指定子节点<br/><parametername=""property=""/><br/>"name"指url参数名<br/>"property"指Seire属性--值从里面进行获取<br/>]]></xsd:documentation></xsd:annotation><xsd:complexType><xsd:choice><xsd:elementname="parameter"minOccurs="0"maxOccurs="unbounded"><xsd:complexType><xsd:attributename="name"type="xsd:string"/><xsd:attributename="property"type="xsd:string"/></xsd:complexType></xsd:element></xsd:choice><xsd:attributename="type"type="xsd:string"use="required"/><xsd:attributename="property"type="xsd:string"use="required"/><xsd:attributename="link"type="xsd:string"/></xsd:complexType></xsd:element></xsd:sequence></xsd:complexType></xsd:element></xsd:schema>
<?xmlversion="1.0"encoding="UTF-8"?><configurationxmlns="http://www.i99tv.com/base/configuration"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.i99tv.com/base/configurationhttp://www.i99tv.com/standard.xsd"><id>101</id><name>天上人间动漫</name><homepage>http://www.52tian.net</homepage><description>此配置针对天上人间动漫进行解析</description><class>parser.x.Tian</class><serie><linktype="japan"value="http://www.52tian.net/----3-------{index}/"/><linktype="china"value="http://www.52tian.net/----1-------{index}/"/><linktype="english"value="http://www.52tian.net/----4-------{index}/"/></serie><episodetype="in"property="sourceURL"/></configuration>