Esempio DTD XML

In questo esempio viene descritto un DTD XML in un documento XML e il relativo formato di struttura ad albero:

<!DOCTYPE test PUBLIC "//this/is/a/URI/test" "test.dtd" [
<!NOTATION TeX  PUBLIC "//this/is/a/URI/TexID" "//TexID">
<!ENTITY ent1 "this is an entity">
<!ENTITY % ent2 "#PCDATA | subel2">
<!ENTITY % extent1 PUBLIC "//this/is/a/URI/extent1" "more.txt">
<!ENTITY extent2 PUBLIC "//this/is/a/URI/extent2" "more.txt">
<!ENTITY unpsd PUBLIC "//this/is/a/URI/me.gif" "me.gif" NDATA TeX>      
<?test Do this?>
<!--this is a comment-->
<!ELEMENT subel2 (#PCDATA)>
<!ELEMENT subel1 (subel2 | el4)+>
<!ELEMENT el1 (#PCDATA)>
<!ELEMENT el2 (#PCDATA | subel2)*>
<!ELEMENT el3 (#PCDATA | subel2)*>
<!ELEMENT el4 (#PCDATA)>
<!ELEMENT el5 (#PCDATA | subel1)*>
<!ELEMENT el6 (#PCDATA)>
<!ATTLIST subel1 
	size (big | small) "big" 
	shape (round | square) #REQUIRED>
<!ATTLIST el5 
	el5satt CDATA #IMPLIED>
]>

Quando si analizza un messaggio con il programma di analisi XML generico, la parte rilevante dell'albero dei messaggi viene visualizzata come riportato di seguito (si presume che non siano presenti ritorni a capo o spazi vuoti tra i tag):


Struttura ad albero di DTD XML di esempio

Nella struttura IntSubset sono contenute le seguenti strutture al livello successivo di nidificazione: la struttura ad albero di ciascuna di queste viene visualizzata nelle strutture ad albero riportate di seguito.


Strutture albero IntSubset XML di es. (1 di 3)

Strutture albero IntSubset XML di es. (1 di 3)

Strutture albero IntSubset XML di es. (1 di 3)

Strutture albero IntSubset XML di es. (1 di 3)

Strutture albero IntSubset XML di es. (2 di 3)

Strutture albero IntSubset XML di es. (2 di 3)

Strutture albero IntSubset XML di es. (2 di 3)

Strutture albero IntSubset XML di es. (2 di 3)

Strutture albero IntSubset XML di es. (2 di 3)

Strutture albero IntSubset XML di es. (2 di 3)

Strutture albero IntSubset XML di es. (2 di 3)

Strutture albero IntSubset XML di es. (2 di 3)

Strutture albero IntSubset XML di es. (2 di 3)

Strutture albero IntSubset XML di es. (2 di 3)

Strutture albero IntSubset XML di es. (3 di 3)

Strutture albero IntSubset XML di es. (3 di 3)

Strutture albero IntSubset XML di es. (3 di 3)

Strutture albero IntSubset XML di es. (3 di 3)

Strutture albero IntSubset XML di es. (3 di 3)
Riferimenti correlati
Dichiarazione del tipo documento XML
DocTypeDecl XML
NotationDecl XML
Entità XML
ElementDef XML
AttributeList XML
AttributeDef XML
DocTypePI XML
WhiteSpace e DocTypeWhiteSpace XML
DocTypeComment XML
Informazioni particolari | Marchi | Download | Libreria | Supporto | Commenti
Copyright IBM Corporation 1999, 2006 Ultimo aggiornamento: ago 17, 2006
ad09195_