Exemplo de DTD XML

Este exemplo mostra um DTD XML em um documento XML e o formato da estrutura da árvore desse documento:

<!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?>
<!--isto é um comentário-->
<!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 uma mensagem é analisada pelo analisador XML genérico, a parte relevante da árvore de mensagens terá o seguinte aspecto (assumindo que não existem retornos de carro nem espaços em branco entre as tags):


Estrutura da Árvore DTD XML de Exemplo

A estrutura IntSubset contém as seguintes estruturas no próximo nível de aninhamento: a estrutura de árvore para cada uma delas é mostrada nas estruturas de árvore a seguir.


Example XML IntSubset tree structures (Part 1 of 3)

Example XML IntSubset tree structures (Part 1 of 3)

Example XML IntSubset tree structures (Part 1 of 3)

Example XML IntSubset tree structures (Part 1 of 3)

Example XML IntSubset tree structures (Part 2 of 3)

Example XML IntSubset tree structures (Part 2 of 3)

Example XML IntSubset tree structures (Part 2 of 3)

Example XML IntSubset tree structures (Part 2 of 3)

Example XML IntSubset tree structures (Part 2 of 3)

Example XML IntSubset tree structures (Part 2 of 3)

Example XML IntSubset tree structures (Part 2 of 3)

Example XML IntSubset tree structures (Part 2 of 3)

Example XML IntSubset tree structures (Part 2 of 3)

Example XML IntSubset tree structures (Part 2 of 3)

Example XML IntSubset tree structures (Part 3 of 3)

Example XML IntSubset tree structures (Part 3 of 3)

Example XML IntSubset tree structures (Part 3 of 3)

Example XML IntSubset tree structures (Part 3 of 3)

Example XML IntSubset tree structures (Part 3 of 3)
Referências relacionadas
declaração do tipo de documento XML
DocTypeDecl XML
NotationDecl XML
Entidades XML
ElementDef XML
AttributeList XML
AttributeDef XML
DocTypePI XML
WhiteSpace XML e DocTypeWhiteSpace
DocTypeComment XML
Avisos | Marcas Registradas | Downloads | Biblioteca | Suporte | Feedback
Direitos Autorais IBM Corporation 1999, 2006 Última Atualização: 1 Sep 2006
ad09195_