XML-skema sluit Element in
❮ Voltooi XML-skemaverwysing
Definisie en gebruik
Die include-element word gebruik om veelvuldige skemas met dieselfde teikennaamruimte by 'n dokument te voeg.
Elementinligting
- Ouerelemente: skema
Sintaksis
<include
id=ID
schemaLocation=anyURI
any attributes
>
(annotation?)
</include>
(Die ? teken verklaar dat die element nul of een keer binne die insluit element kan voorkom)
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 |
Voorbeeld 1
Met ingeslote skemas moet die ingeslote lêers almal dieselfde teikennaamspasie verwys. As die skemateikennaamruimte nie ooreenstem nie, sal die insluit nie werk nie:
<?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>
❮ Voltooi XML-skemaverwysing