Schéma XML zahrnuje prvek
❮ Vyplňte odkaz na schéma XML
Definice a použití
Element include se používá k přidání více schémat se stejným cílovým jmenným prostorem do dokumentu.
Informace o prvku
- Nadřazené prvky: schéma
Syntax
<include
id=ID
schemaLocation=anyURI
any attributes
>
(annotation?)
</include>
(Znak ? deklaruje, že prvek se uvnitř prvku include může vyskytovat nula nebo jednou)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
schemaLocation | Required. Specifies the URI to the schema to include in the target namespace of the containing schema |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
Příklad 1
Se zahrnutými schématy musí všechny zahrnuté soubory odkazovat na stejný cílový jmenný prostor. Pokud se cílový jmenný prostor schématu neshoduje, zahrnutí nebude fungovat:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="https://www.w3schools.com/schema">
<xs:include schemaLocation="https://www.w3schools.com/xml/customer.xsd"/>
<xs:include schemaLocation="https://www.w3schools.com/xml/company.xsd"/>
..
..
..
</xs:schema>
❮ Vyplňte odkaz na schéma XML