Übung XML Schema Bookhttps://www.std.ch/Deutschland JEXS?&atomFri, 29 Mar 2024 07:50:37 +0000stack.ch
https://stack.ch/
08302296-eda1-11ee-8c11-005056bb85fbSimtech AG - Ausbildung - XML - Kurs XML Transformation - Kurs XML Transformation - Ressourcen - Kurs XML Transformation - Übungen - Übung XML Schema Book
https://www.std.ch/Deutschland JEXS
08302422-eda1-11ee-8c11-005056bb85fbFri, 29 Mar 2024 07:50:37 +0000Übung XML Schema Book
https://www.std.ch/Deutschland JEXS
08302585-eda1-11ee-8c11-005056bb85fbFri, 29 Mar 2024 07:50:37 +0000
https://www.std.ch/Deutschland JEXS
083026ab-eda1-11ee-8c11-005056bb85fbFri, 29 Mar 2024 07:50:37 +0000Wir möchten unser XML Dokument mit einem XML Schema validieren können. Als Vorlage dient uns das folgenden Book Dokument:<?xml version="1.0" encoding="UTF-8"?>
<document>
<book>
<title>XSLT</title>
<author>Michael Kay</author>
<publisher>Wrox Press Ltd.</publisher>
<isbn>1-861003-12-9</isbn>
</book>
<book>
<title>XML and Java</title>
<author>Hiroshi Maruyama</author>
<author>Kent Tamura</author>
<author>Naohiko Uramoto</author>
<publisher>Addison Wesley</publisher>
<isbn>0201485435</isbn>
</book>
<book>
<title>Java and XML</title>
<author>Brett McLaughlin</author>
<author>Mike Loukides</author>
<publisher>O'Reilly</publisher>
<isbn>0596000162</isbn>
</book>
</document>
https://www.std.ch/Deutschland JEXS
08302cea-eda1-11ee-8c11-005056bb85fbFri, 29 Mar 2024 07:50:37 +0000Erstellen Sie im Visual Code Editor das Book Dokument gemäss dem zuvor angegebenen Listing.Auf dem document-Element wird eine Warnung ... angezeigt. Solche besagt, dass keine DTD oder Schema dem Dokument zugeordnet ist:Wählen Sie die erste Option und damit wird ein erstes XML Schema erstellt. Dieses Schema enthält die Informationen, wie das Book Dokument aussehen soll. Das XML Dokument wird mit dem Schema über das Root Element verlinkt und validiert. Das automatisch generierte XML Schema:<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="document">
<xs:complexType>
<xs:sequence>
<xs:element name="book" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string" />
<xs:element name="author" maxOccurs="unbounded" type="xs:string" />
<xs:element name="publisher" type="xs:string" />
<xs:element name="isbn" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>Das generierte XML Schema arbeitet mit anonymen Typen.
https://www.std.ch/Deutschland JEXS
08303de6-eda1-11ee-8c11-005056bb85fbFri, 29 Mar 2024 07:50:37 +0000In der Praxis arbeiten wir besser mit Named Types. Wir kopieren das book.xml Dokument um nach book2.xml und das book.xsd nach book2.xsd. Das book2.xsd passen wir wie folgt an:<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="document" type="bookType" />
<xs:complexType name="bookType">
<xs:sequence>
<xs:element name="book" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string" />
<xs:element name="author" maxOccurs="unbounded" type="xs:string" />
<xs:element name="publisher" type="xs:string" />
<xs:element name="isbn" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>Verlinken Sie das book2.xml Dokument mit dem XML Schema book2.xsd, das Verhalten sollte identisch sein. Über uns
https://www.std.ch/about
Fri, 29 Mar 2024 07:50:37 +000008304382-eda1-11ee-8c11-005056bb85fbAktuell
https://www.std.ch/
Fri, 29 Mar 2024 07:50:37 +0000083046c4-eda1-11ee-8c11-005056bb85fbAGB
https://www.std.ch/agb
Fri, 29 Mar 2024 07:50:37 +00000830475e-eda1-11ee-8c11-005056bb85fbBildungswege
https://www.std.ch/bildungswege
Fri, 29 Mar 2024 07:50:37 +0000083047f9-eda1-11ee-8c11-005056bb85fbBlog
https://www.std.ch/blog
Fri, 29 Mar 2024 07:50:37 +0000083048fd-eda1-11ee-8c11-005056bb85fbRufen Sie mich an
https://www.std.ch/callus
Fri, 29 Mar 2024 07:50:37 +000008304ae1-eda1-11ee-8c11-005056bb85fbCharts
https://www.std.ch/charts
Fri, 29 Mar 2024 07:50:37 +000008304bf1-eda1-11ee-8c11-005056bb85fbConsulting
https://www.std.ch/consulting
Fri, 29 Mar 2024 07:50:37 +000008304cfe-eda1-11ee-8c11-005056bb85fbKontakt
https://www.std.ch/contact
Fri, 29 Mar 2024 07:50:37 +000008304e3c-eda1-11ee-8c11-005056bb85fbAusbildung/Kurse
https://www.std.ch/education
Fri, 29 Mar 2024 07:50:37 +000008304fbd-eda1-11ee-8c11-005056bb85fbSoftware Engineering
https://www.std.ch/engineering
Fri, 29 Mar 2024 07:50:37 +00000830508b-eda1-11ee-8c11-005056bb85fbFreelancer
https://www.std.ch/freelancer
Fri, 29 Mar 2024 07:50:37 +00000830512d-eda1-11ee-8c11-005056bb85fbImpressum
https://www.std.ch/impressum
Fri, 29 Mar 2024 07:50:37 +0000083051cc-eda1-11ee-8c11-005056bb85fbKursleiter
https://www.std.ch/kursleiter
Fri, 29 Mar 2024 07:50:37 +000008305263-eda1-11ee-8c11-005056bb85fbNetzwerk
https://www.std.ch/network
Fri, 29 Mar 2024 07:50:37 +0000083052fd-eda1-11ee-8c11-005056bb85fbReferenzen
https://www.std.ch/references
Fri, 29 Mar 2024 07:50:37 +0000083053aa-eda1-11ee-8c11-005056bb85fbSitemap
https://www.std.ch/sitemap
Fri, 29 Mar 2024 07:50:37 +00000830544a-eda1-11ee-8c11-005056bb85fbTools
https://www.std.ch/tools
Fri, 29 Mar 2024 07:50:37 +0000083054fc-eda1-11ee-8c11-005056bb85fbVision
https://www.std.ch/vision
Fri, 29 Mar 2024 07:50:37 +000008305596-eda1-11ee-8c11-005056bb85fb