XML-Schema - Importelement
❮ Vollständige XML-Schema-Referenz
Definition und Verwendung
Das import-Element wird verwendet, um einem Dokument mehrere Schemas mit unterschiedlichen Zielnamensräumen hinzuzufügen.
Elementinformationen
- Übergeordnete Elemente: Schema
Syntax
<import
id=ID
namespace=anyURI
schemaLocation=anyURI
any attributes
>
(annotation?)
</import>
(Das ?-Zeichen gibt an, dass das Element null oder einmal innerhalb des Import-Elements vorkommen kann.)
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 |
Beispiel 1
Das folgende Beispiel zeigt, wie ein Namespace importiert wird:
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="https://www.w3schools.com/schema"/>
..
..
..
</xs:schema>
❮ Vollständige XML-Schema-Referenz