-
XML = Extensible Markup Language
-
Dieser Standard ist Lesbar für Maschinen und Menschen
Es wurde als Standard zum DatenAustausch entwickelt
XML Elemente
<buch>
Grundlagen von XML <-- Content des Elements
</buch>XML : Attribute
<buch preis="19,95 Euro" auflage="2.">
<titel> Grundlagen von XML </titel>
</buch>- when to use child elements / when to use attributes
<book>
<authors>
<author> John Doe </author>
<author> Jane Smith </author>
</authors>
</book>XML : Declaration
-
Use UTF-8 instead of
ISO-8859-1
DTD : Declaration
-
DTD : Document Type Definition, specifies rules on how XML Files are structured
-
an XML is valid, if it follows these rules
<!ELEMENT katalog (buch*)>
<!ELEMENT buch (author*, titel)>
<!ELEMENT vorname (\#PCDATA)>
<!ELEMENT nachname (\#PCDATA)>
<!ELEMENT titel (\#PCDATA)><!ELEMENT para (\#PCDATA | example | figure | table)*>-
Wir benutztn PCDATA für Elemrente, und CDATA für Attribute.
-
P bedeutet dass der Parser diesen Text scannt und darin
&oder<erkennt.
Beispiele :
-
Verlag O’Reilly :
<buch verlag =’O'Reilly’ </buch> -
>für das Zeichen> -
"für das Zeichen" -
'für das Zeichen' -
Kommentare in XML :
<!- - DAs ist ein Comment - - >
<!ATTLIST buch
ISBN DATA \#REQUIRED
preis CDATA \#REQUIRED
author CDATA \#REQUIRED
><!ATTLIST eintrag
name ID \#REQUIRED
elterneintrag IDREF \#REQUIRED
>Makro as Entity
<!ENTITY sb "Saarbruecken">
<info> Er ist 35 und wohnt in &sb;.</info>Important
DTD Files können
standalonesein → werden nicht validiert
Mit Reglwerk → werden gegen diese Rules geprüft
ASCII ZeichenSatz
Wir können 128 Chars encoden
UniCode
-
Unicode defines >100K characters
-
is a SuperSet of ASCII → No mismatches
Important
U+0054 (HEX) → 84 (DEZ) → T (ASCII)
If Possible, use UTF-8, or at least the same encoding everywhere