Élément d'importation de schéma XML
❮ Référence complète du schéma XML
Définition et utilisation
L'élément d'importation est utilisé pour ajouter plusieurs schémas avec un espace de noms cible différent à un document.
Informations sur l'élément
- Éléments parents : schéma
Syntaxe
<import
id=ID
namespace=anyURI
schemaLocation=anyURI
any attributes
>
(annotation?)
</import>
(Le signe ? déclare que l'élément peut apparaître zéro ou une fois dans l'élément d'importation)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
namespace | Optional. Specifies the URI of the namespace to import |
schemaLocation | Optional. Specifies the URI to the schema for the imported namespace |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
Exemple 1
L'exemple suivant montre comment importer un espace de noms :
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="https://www.w3schools.com/schema"/>
..
..
..
</xs:schema>
❮ Référence complète du schéma XML