schema举例一:

 <?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.weshare.com.cn"
xmlns="http://www.weshare.com.cn"
elementFormDefault="qualified"> <xs:element name="actionGroup">
<xs:complexType>
<xs:sequence>
<xs:element name="action" maxOccurs="unbounded">
<xs:complexType>
<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="fun" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="param" type="xs:string" use="required"/>
</xs:attributeGroup> </xs:schema>

XML范例:

 <?xml version="1.0" encoding="UTF-8"?>
<actionGroup id="3333"
xmlns="http://www.weshare.com.cn"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:///C:/workspace/Tools/UpdateProject/script_update_common/src/main/resources/schema/project/actionGroup.xsd"> <action id="" fun="" type="" param=""/>
<action id="" fun="" type="" param=""/>
</actionGroup>

引用示例二:

 <?xml version="1.0"?>
<note
xmlns="http://www.w3schools.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3schools.com note.xsd">
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
05-06 06:20