原创:xml 验证 教程 schema 编辑器/设计器

schema教程:http://www.w3school.com.cn/schema/schema_facets.asp

schemag工具:Stylus Studio XML Enterprise Suite 2010 v11.1.1540b 多语言版(含中文)右键使用迅雷下载

示例:

xml:

<?xml version="1.0"?>
<p1:ut xmlns:p1="http://www.comsys.net.cn/schema/ut" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.comsys.net.cn/schema/ut file:///c:/Documents%20and%20Settings/Administrator/桌面/UT.xsd">
    <conf name="system">
        <property name="a1" type="string">防守对方</property>
        <property name="a2" type="string">斯蒂芬森</property>
        <property name="a9" type="string">斯蒂司法所sdf芬森</property>
        <property name="a9" type="list">斯蒂司法所sdf芬森</property>
        <property name="a10" type="list">
            <value></value>
            <value></value>
            <value></value>
            <value></value>
        </property>
    </conf>
    <conf name="udm">
        <property name="b1" type="string">12312</property>
        <property name="b2" type="string">3453</property>
        <property name="b9" type="string">sdfsdfs</property>
    </conf>
 
</p1:ut>

shema:

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.comsys.net.cn/schema/ut" xmlns="http://www.comsys.net.cn/schema/ut">
    <xsd:element name="ut">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="conf" minOccurs="0" maxOccurs="unbounded">
                    <xsd:complexType >
                        <xsd:sequence>
                            <xsd:element name="property" minOccurs="0" maxOccurs="unbounded"  >
                                <xsd:complexType mixed="true">
                                    <xsd:sequence>
                                      <xsd:element name="value" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
                                    </xsd:sequence>
                                    <xsd:attribute name="name"/>
                                    <xsd:attribute name="type" use="optional"  default="string">
                                        <xsd:simpleType>
                                          <xsd:restriction base="xsd:string">
                                            <xsd:enumeration value="string"/>
                                            <xsd:enumeration value="list"/>
                                          </xsd:restriction>
                                        </xsd:simpleType>
                                    </xsd:attribute>
                                    
                                    
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                        <xsd:attribute name="name"/>
                        
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>
原文地址:https://www.cnblogs.com/jifeng/p/2620264.html