schema举例二:

 <?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.weshare.com.cn/hbaseGroup"
xmlns="http://www.weshare.com.cn/hbaseGroup"
elementFormDefault="qualified"> <xs:element name="hbaseGroup">
<xs:complexType>
<xs:sequence>
<xs:element name="statements" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="statement" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="property" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="type" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attributeGroup ref="AttributeGroup"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required"></xs:attribute>
</xs:complexType>
</xs:element> <xs:attributeGroup name="AttributeGroup">
<xs:attribute name="id" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:attributeGroup> </xs:schema>

XML范例:

 <?xml version="1.0" encoding="UTF-8"?>
<hbaseGroup id="id"
xmlns="http://www.weshare.com.cn/hbaseGroup"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:///C:/workspace/Tools/UpdateProject/script_update_common/src/main/resources/schema/project/hbaseGroup.xsd">
<statements id="" type="">
<statement>
<property type=""/>
<property type=""/>
</statement>
<statement>
<property type=""/>
</statement>
</statements>
<statements id="" type="">
<statement>
<property type=""/>
</statement>
</statements> </hbaseGroup>
05-11 22:26