XML Schema 参考手册 完整 XML Schema 参考手册 The include element is used to add multiple schema with the same target namespace to a document. 父元素: Schema (? The symbol is declared in the include element, which can appear zero or once. ) Attribute Description Id Optional. Specifies the unique ID of the element. SchemaLocation Necessary. Specifies the URI of the schema to be included in the target namespace that contains schema. Any attributes Optional. Specifies any other attributes with the non-schema namespace. With the included schema, the included files must all refer to the same target namespace. If the schema target namespace does not match, the include will not be valid:Definition and usage ¶
Element information ¶
Grammar ¶
<include
id=ID
schemaLocation=anyURI
*any attributes*
>
(annotation?)
</include>
Example 1 ¶
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.runoob.com/schema">
<xs:include
schemaLocation="https://www.runoob.com/schema/customer.xsd"/>
<xs:include schemaLocation="https://www.runoob.com/schema/company.xsd"/>
..
..
..
</xs:schema>