Einleitung
XML Schema Sprachkonstrukte: Structure
XML Schema Sprachkonstrukte: Datatypes
Beispiele
Stand der Entwicklung

Ersatz und Erweiterung für XML DTD
(Neben-)bedingungen für Aufbau der Dokumentenstruktur
z.B. Anzahl bestimmter Elemente
Bedingungen über Datentypen für Elemente und Attribute
z.B. Integer, Float, URL
Objektorientierung und Vererbung
mehrere konkurrierende Ansätze:
XDR (XML-Data Reduced, BizTalk),
SOX (Schema for Object-Oriented XML),
Schematron,
DSD (Document Structure Description),
XML Schema
seit Mitte 2001 W3C Recommendation
Beispiel in XML
<!ELEMENT KontoStand (#PCDATA) >und XML-Schema
<element name="KontoStand"> <simpleType type="float" /> </element>
class Bestellung {
Integer lfdNr;
String bemerkung;
Date bestellDatum;
Date lieferDatum;
Adresse rechnungsAdresse;
Adresse lieferAdresse;
Artikel[] artikel;
}
class Adresse {
String vorName;
String nachName;
String strasse;
Integer plz;
String ort;
}
class Artikel {
Integer aNr;
String bezeichnung;
Float preis;
Integer anzahl;
}
class Date { ... }
Wie können diese Informationen typsicher über das Internet ausgetauscht werden?
Mit XML ist nur die folgende Definition möglich.
<!ELEMENT Bestellung (lfdNr, bemerkung?,
bestellDatum, lieferDatum,
rechnungsAdresse, lieferAdresse,
waren) >
<!ELEMENT lfdNr (#PCDATA) >
<!ELEMENT bemerkung (#PCDATA) >
<!ELEMENT bestellDatum (#PCDATA) >
<!ELEMENT lieferDatum (#PCDATA) >
<!ELEMENT rechnungsAdresse (vorName, nachName,
strasse, plz, ort) >
<!ELEMENT lieferAdresse (vorName, nachName,
strasse, plz, ort) >
<!ELEMENT vorName (#PCDATA) >
<!ELEMENT nachName (#PCDATA) >
<!ELEMENT strasse (#PCDATA) >
<!ELEMENT plz (#PCDATA) >
<!ELEMENT ort (#PCDATA) >
<!ELEMENT waren (artikel+) >
<!ELEMENT artikel (aNr, bezeichnung?,
preis?, anzahl) >
<!ELEMENT aNr (#PCDATA) >
<!ELEMENT bezeichnung (#PCDATA) >
<!ELEMENT preis (#PCDATA) >
<!ELEMENT anzahl (#PCDATA) >
Probleme mit dieser Definition:
lfdNr, plz, aNr, anzahl sind nur als Zeichenkette definiert,
nicht als Integer
preis ist nur als Zeichenkette definiert,
nicht als Float
bestellDatum, lieferDatum sind nur als Zeichenkette definiert,
nicht als echter normalisierter Datumstyp
folgendes fehlerhaftes Dokument lässt sich damit definieren:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE Bestellung SYSTEM "Bestellung.dtd" > <lfdNr>4711</lfdNr> <bemerkung>eilig</bemerkung> <bestellDatum>12.1.01</bestellDatum> <lieferDatum>2001-01-30</lieferDatum> <rechnungsAdresse> <vorName>Karl</vorName> <nachName>Dall</nachName> <strasse>L 15, 16</strasse> <plz>68131</plz> <ort>Mannheim</ort> </rechnungsAdresse> <lieferAdresse> <vorName>Karl</vorName> <nachName>Knallinger</nachName> <strasse>A 5, 6</strasse> <plz>D-68131</plz> <ort>Mannheim</ort> </lieferAdresse> <waren> <artikel> <aNr>4712</aNr> <anzahl>zwei</anzahl> </artikel> <artikel> <aNr>4713</aNr> <anzahl>-3</anzahl> </artikel> </waren> </Bestellung>
Eine XML Schema Definition mit streng typisierten Definitionen folgen im Abschnitt Beispiele
in XML DTD:
<!ELEMENT ename (cname*,econtent) > <!ATTLIST ename aname atyp awert >
XML Schema Definition:
<element name="ename" > <complexType> <sequence> <element name="cname" type="mytype" maxOccurs="5" /> econtent </sequence> <attribute name="aname" > <simpleType type="atyp" value="awert" /> </attribute> </complexType> </element>
genauere Kontrolle über die Datentypen im Content
Bedingungen über die Anzahl und der Datentypen: Basis, Derived, eigene
Kontrolle über die Datentypen und Werte von Attributen
in der gleichen Weise wie für Elemente
XML Schema Namespaces
(Prefix oft xsd:)
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
und für XML-Schema Dokumente
(Prefix oft xsi:)
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
URI für XML-Schema Definitionen
xsi:schemaLocation='url1 url2 url3 ...'
xsi:noNamespaceSchemaLocation='datei.name'
minimal
für alle Programme und Tools, die Schema Validieren
representational
Validieren auch externe XML-Repesentationen von Schema Definitionen
full
Validieren auch Schema im WWW
einfache / elementare Typen (simple types)
zusammengesetzte Typen (complex types)
Attribute (attributs)
Elemente (elements)
Attribut-Gruppen
Identity Constraints
key, keyref, unique
Modell Gruppen
Folgen (sequence), Conjunction (All-Listen),
Disjunction (Choice-Listen)
Notationen
public, system URI
Annotationen, Bemerkungen, Kommentare
Partikel (particle, Inhaltsmodell, Inhalt, Wildcards)
Wildcards (für Namensräume)
Beschränkungen (contraints) der Datentypen
length, minLength, maxLength
bei Listen und Zeichenketten
pattern, enumeration
fast überall
maxInclusive, maxExclusive,
minInclusive, minExclusive
bei Zahlen und Zeiten
precision, scale
bei Zahlen
duration, period
bei Zeiten
<schema
xmlns="http://www.w3.org/2000/10/XMLSchema
targetNamespace="http://purl.org/metadata/dublin_core"
version="M.n"
>
Content: ((include | import | redefine | annotation)* ,
((attribute | attributeGroup |
complexType | element | group | notation | simpleType),
annotation*)*)
</schema>
Root Element, enthält alle anderen Konstrukte
<element
default = string
fixed = string
maxOccurs = for maxOccurs : 1
minOccurs = nonNegativeInteger : 1
name = NCName
type = QName
...
>
Content: (annotation? ,
((simpleType | complexType)? ,
(key | keyref | unique)*))
</element>
Element, wie in XML
Datentypen können per type Attribut
referenziert werden
Datentypen können auch direkt im Content definiert werden
<attribute
name = NCName
type = QName
use = prohibited | optional | required | default | fixed : optional
value = string
...
>
Content: (annotation? , (simpleType?))
</attribute>
Im Content von Attributen können einfache Datentypen definiert werden
Datentypen können auch per type Attribut
referenziert werden
<complexType
mixed = boolean : false
name = NCName
...
>
Content: (annotation? ,
(simpleContent | complexContent |
((group | all | choice | sequence)? ,
((attribute | attributeGroup)* ,
anyAttribute?))
))
</complexType>
Definition von Datentypen, die komplexeren Content haben können (Folgen, Mengen, Selektionen, Content, Attribute)
Inhaltsmodell: group | all | choice | sequence
Inhalt: simpleContent | complexContent
Attribute: attribute | attributeGroup, anyAttribute
<simpleType
name = NCName
...
>
Content: (annotation? ,
((list | restriction | union)))
</simpleType>
Definition von einfachen Datentypen, die keine Attribute haben können mit einfachem Content
<complexContent
id = ID
mixed = boolean
...
>
Content: (annotation?,
(restriction | extension))
</complexContent>
Definition des Inhalts eines Elements als Erweiterung oder Einschränkung eines Datentyps
mixed = true: wenn Text und Elemente gemischt sein dürfen
<simpleContent
id = ID
...
>
Content: (annotation?,
(restriction | extension))
</simpleContent>
Definition eines einfachen Inhalts eines Elements nur als Erweiterung oder Einschränkung eines Datentyps
<restriction
base = QName
id = ID
...
>
simpleContent: (annotation?,
(simpleType?,
(minExclusive | minInclusive | maxExclusive | maxInclusive
| totalDigits | fractionDigits | length | minLength
| maxLength | enumeration | whiteSpace | pattern)*)?,
((attribute | attributeGroup)*, anyAttribute?))
compelexContent: (annotation?,
(group | all | choice | sequence)?,
((attribute | attributeGroup)*, anyAttribute?))
</restriction>
Einschränkung eines einfachen bzw. komplexen Datentyps
bei simpleType Facetten
bei complexType Inhaltsmodell
<extension
base = QName
id = ID
...
>
simpleContent: (annotation?,
((attribute | attributeGroup)*, anyAttribute?))
complexContent: (annotation?,
((group | all | choice | sequence)?,
((attribute | attributeGroup)*, anyAttribute?)))
</extension>
Erweiterung eines einfachen bzw. komplexen Datentyps
bei simpleType nur Attribute
bei complexType Inhaltsmodell
<attributeGroup
name = NCName
...
>
Content: (annotation? ,
((attribute | attributeGroup)* ,
anyAttribute?))
</attributeGroup>
zur Zusammenfassung von Attributen zu Gruppen
<group
maxOccurs = for maxOccurs : 1
minOccurs = nonNegativeInteger : 1
name = NCName
...
>
Content: (annotation? ,
(all | choice | sequence)?)
</group>
zur Zusammenfassung von Elementen zu Gruppen
<notation
name = NCName
public = A public identifier, per ISO 8879
system = uriReference
...
>
Content: (annotation?)
</notation>
Definition von Bezeichnugen
<annotation> Content: (appinfo | documentation)* </annotation>
zur Dokumentation der Schema-Definitionen
name = NCName variety = ( atomic | list | union ) [baseTypeDefinition] [facets] [fundamentalFacets] [annotation]
Definition der primitiven, abgeleiteten und eigenen Datentypen
Einschränkung oder Erweiterung des Datentyps durch Facetten
Facetten sind:
Muster (pattern), Aufzählungen (enumeration),
Längenbeschränkungen, Wertebereichsbeschränkungen,
Genauigkeit bei Zahlen
| {base type definition} | applicable {facets} | |
|---|---|---|
| If {variety} is list, then | ||
| [all datatypes] | length, minLength, maxLength, enumeration | |
| If {variety} is union, then | ||
| [all datatypes] | pattern, enumeration | |
| else if {variety} is atomic, then | ||
| primitive | string | length, minLength, maxLength, pattern, enumeration |
| boolean | pattern | |
| float | pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| double | pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| decimal | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| timeDuration | pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| recurringDuration | duration, period, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| binary | encoding, length, minLength, maxLength, pattern, enumeration | |
| uriReference | length, minLength, maxLength, pattern, enumeration | |
| ID | length, minLength, maxLength, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| IDREF | length, minLength, maxLength, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| ENTITY | length, minLength, maxLength, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| NOTATION | length, minLength, maxLength, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| QName | length, minLength, maxLength, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| derived | language | length, minLength, maxLength, pattern, enumeration |
| IDREFS | length, minLength, maxLength, enumeration | |
| ENTITIES | length, minLength, maxLength, enumeration | |
| NMTOKEN | length, minLength, maxLength, pattern, enumeration | |
| NMTOKENS | length, minLength, maxLength, enumeration | |
| Name | length, minLength, maxLength, pattern, enumeration | |
| NCName | length, minLength, maxLength, pattern, enumeration | |
| integer | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| nonPositiveInteger | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| negativeInteger | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| long | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| int | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| short | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| byte | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| nonNegativeInteger | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| unsignedLong | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| unsignedInt | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| unsignedShort | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| unsignedByte | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| positiveInteger | precision, scale, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| timeInstant | duration, period, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| time | duration, period, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| timePeriod | duration, period, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| date | duration, period, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| month | duration, period, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| year | duration, period, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| century | duration, period, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| recurringDate | duration, period, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
| recurringDay | duration, period, pattern, enumeration, maxInclusive, maxExclusive, minInclusive, minExclusive | |
Quelle: W3C, 2000
Einfache Schema Definition mit den Datentypen
string, integer, decimal in Anlehnung
an die XML DTD.
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <xsd:element name="Bestellung"> <xsd:complexType> <xsd:sequence> <xsd:element name="lfdNr" type="xsd:string" /> <xsd:element name="bemerkung" type="xsd:string" /> <xsd:element name="bestellDatum" type="Date" /> <xsd:element name="lieferDatum" type="Date" /> <xsd:element name="rechnungsAdresse" type="Adresse" /> <xsd:element name="lieferAdresse" type="Adresse" /> <xsd:element name="waren" type="Waren" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name="Adresse"> <xsd:sequence> <xsd:element name="vorName" type="xsd:string" /> <xsd:element name="nachName" type="xsd:string" /> <xsd:element name="strasse" type="xsd:string" /> <xsd:element name="plz" type="xsd:integer" /> <xsd:element name="ort" type="xsd:string" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Waren"> <xsd:sequence> <xsd:element name="artikel" type="Artikel" maxOccurs="10" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Artikel"> <xsd:sequence> <xsd:element name="aNr" type="xsd:integer" /> <xsd:element name="bezeichnung" type="xsd:string" minOccurs="0" /> <xsd:element name="preis" type="xsd:decimal" minOccurs="0" /> <xsd:element name="anzahl" type="xsd:integer" /> </xsd:sequence> </xsd:complexType> <xsd:simpleType name="Date" > <xsd:restriction base="xsd:string" /> </xsd:simpleType> </xsd:schema>
Beispiel-Dokument mit Fehlern.
<?xml version="1.0" encoding="UTF-8" ?>
<Bestellung xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='Bestellung-1.xsd'>
<lfdNr>4711</lfdNr>
<bemerkung>eilig</bemerkung>
<bestellDatum>12.1.01</bestellDatum>
<lieferDatum>2001-01-30</lieferDatum>
<rechnungsAdresse>
<vorName>Karl</vorName>
<nachName>Dall</nachName>
<strasse>L 15, 16</strasse>
<plz>68131</plz>
<ort>Mannheim</ort>
</rechnungsAdresse>
<lieferAdresse>
<vorName>Karl</vorName>
<nachName>Knallinger</nachName>
<strasse>A 5, 6</strasse>
<plz>D-68131</plz>
<ort>Mannheim</ort>
</lieferAdresse>
<waren>
<artikel>
<aNr>4712</aNr>
<anzahl>zwei</anzahl>
</artikel>
<artikel>
<aNr>4713</aNr>
<anzahl>-3</anzahl>
</artikel>
</waren>
</Bestellung>
Ohne Fehler:
valid Bestellung-1e.xml Bestellung-1e.xml: 1225 ms (24 elems, 0 attrs, 34 spaces, 104 chars)
schema validiation script:
#!/bin/sh VALIDPATH="/home/kredel/java/lib/xmlParserAPIs.jar:/home/kredel/java/lib/xercesImpl.jar:/home/kredel/java/lib/xercesSamples.jar" export CLASSPATH="$VALIDPATH:$CLASSPATH" /usr/lib/jdk1.3/bin/java sax.Counter -v -s $*
Gefundene Fehler:
schema Bestellung-1e.xsi
[Error] Bestellung-1e.xsi:15:19: cvc-type.3.1.3:
The value 'D-68131' of element 'plz' is not valid.
[Error] Bestellung-1e.xsi:30:22: cvc-type.3.1.3:
The value 'zwei' of element 'anzahl' is not valid.
Bestellung-1e.xsi: 1383 ms (24 elems, 1 attrs, 0 spaces, 138 chars)
Die Datumsprobleme und die Anzahl -3
werden nicht entdeckt.
Alle Beispiele für Apache xerces in aktueller Syntax
date
<?xml version="1.0" encoding="UTF-8" ?>
<Bestellung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='Bestellung-2.xsd'>
<lfdNr>4711</lfdNr>
<bemerkung>eilig</bemerkung>
<bestellDatum>12.1.01</bestellDatum>
<lieferDatum>2001-01-30</lieferDatum>
<rechnungsAdresse>
<vorName>Karl</vorName>
<nachName>Dall</nachName>
<strasse>L 15, 16</strasse>
<plz>68131</plz>
<ort>Mannheim</ort>
</rechnungsAdresse>
<lieferAdresse>
<vorName>Karl</vorName>
<nachName>Knallinger</nachName>
<strasse>A 5, 6</strasse>
<plz>68131</plz>
<ort>Mannheim</ort>
</lieferAdresse>
<waren>
<artikel>
<aNr>4712</aNr>
<preis>DM 22</preis>
<anzahl>2</anzahl>
</artikel>
<artikel>
<aNr>4713</aNr>
<anzahl>3</anzahl>
</artikel>
</waren>
</Bestellung>
Schema Definition:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <xsd:element name="Bestellung"> <xsd:complexType> <xsd:sequence> <xsd:element name="lfdNr" type="xsd:string" /> <xsd:element name="bemerkung" type="xsd:string" /> <xsd:element name="bestellDatum" type="Date" /> <xsd:element name="lieferDatum" type="Date" /> <xsd:element name="rechnungsAdresse" type="Adresse" /> <xsd:element name="lieferAdresse" type="Adresse" /> <xsd:element name="waren" type="Waren" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name="Adresse"> <xsd:sequence> <xsd:element name="vorName" type="xsd:string" /> <xsd:element name="nachName" type="xsd:string" /> <xsd:element name="strasse" type="xsd:string" /> <xsd:element name="plz" type="xsd:integer" /> <xsd:element name="ort" type="xsd:string" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Waren"> <xsd:sequence> <xsd:element name="artikel" type="Artikel" maxOccurs="10" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Artikel"> <xsd:sequence> <xsd:element name="aNr" type="xsd:integer" /> <xsd:element name="bezeichnung" type="xsd:string" minOccurs="0" /> <xsd:element name="preis" type="xsd:decimal" minOccurs="0" /> <xsd:element name="anzahl" type="xsd:integer" /> </xsd:sequence> </xsd:complexType> <xsd:simpleType name="Date" > <xsd:restriction base="xsd:date" /> </xsd:simpleType> </xsd:schema>
Gefundene Fehler (Apache xerces):
schema Bestellung-2e.xsi
[Error] Bestellung-2e.xsi:7:37: cvc-type.3.1.3:
The value '12.1.01' of element 'bestellDatum' is not valid.
[Error] Bestellung-2e.xsi:29:21: cvc-type.3.1.3:
The value 'DM 22' of element 'preis' is not valid.
Bestellung-2e.xsi: 1402 ms (25 elems, 1 attrs, 0 spaces, 138 chars)
pattern und nonNegativeInteger
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<xsd:element name="Bestellung">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="lfdNr" type="xsd:string" />
<xsd:element name="bemerkung" type="xsd:string" />
<xsd:element name="bestellDatum" type="Date" />
<xsd:element name="lieferDatum" type="Date" />
<xsd:element name="rechnungsAdresse" type="Adresse" />
<xsd:element name="lieferAdresse" type="Adresse" />
<xsd:element name="waren" type="Waren" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="Adresse">
<xsd:sequence>
<xsd:element name="vorName" type="xsd:string" />
<xsd:element name="nachName" type="xsd:string" />
<xsd:element name="strasse" type="xsd:string" />
<xsd:element name="plz" type="xsd:integer" />
<xsd:element name="ort" type="xsd:string" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Waren">
<xsd:sequence>
<xsd:element name="artikel" type="Artikel" maxOccurs="10" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="Artikel">
<xsd:sequence>
<xsd:element name="aNr" type="xsd:integer" />
<xsd:element name="bezeichnung" type="xsd:string" minOccurs="0" />
<xsd:element name="preis" type="xsd:decimal" minOccurs="0" />
<xsd:element name="anzahl" type="xsd:nonNegativeInteger" />
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="Date" >
<xsd:restriction base="xsd:string" >
<xsd:pattern value="\d{4}-\d{2}-\d{2}" />
</xsd:restriction >
</xsd:simpleType>
</xsd:schema>
Gefundene Fehler (Apache xerces):
schema Bestellung-3e.xsi
[Error] Bestellung-3e.xsi:7:37: cvc-type.3.1.3:
The value '12.1.01' of element 'bestellDatum' is not valid.
[Error] Bestellung-3e.xsi:33:20: cvc-type.3.1.3:
The value '-3' of element 'anzahl' is not valid.
Bestellung-3e.xsi: 1479 ms (24 elems, 1 attrs, 0 spaces, 133 chars)
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > <xsd:element name="Bestellung"> <xsd:complexType> <xsd:sequence> <xsd:element name="lfdNr" type="xsd:string" /> <xsd:element ref="bemerkung" /> <xsd:element name="bestellDatum" type="Date" /> <xsd:element name="lieferDatum" type="Date" /> <xsd:element name="rechnungsAdresse" type="Adresse" /> <xsd:element name="lieferAdresse" type="Adresse" /> <xsd:element name="waren" type="Waren" /> </xsd:sequence> </xsd:complexType> </xsd:element> ... <xsd:element name="bemerkung" > <xsd:complexType> <xsd:simpleContent> <xsd:extension base="xsd:string" > <xsd:attribute name="priority" type="xsd:string" /> </xsd:extension> </xsd:simpleContent> </xsd:complexType> </xsd:element> </xsd:schema>
xml, dtd, xsd (veraltete Syntax)
14. Januar 2002
XML Schema, Part 0 Primer,
Part 1 Structures, Part 2 Datatypes,
W3C Recommendation, 2. Mai 2001
Tools:
Apache Xerces mit SAX und DOM Parser
Java API for XML Processing (JAXP)
Oracle xmlschema
© Universität Mannheim, Rechenzentrum, 1998-2002.
Heinz Kredel Last modified: Sun Feb 3 13:24:29 MET 2002