Database Reference
In-Depth Information
Figure 11-46
XML Document with Internal
DtD
Although DTDs are almost always desirable, they are not required in XML documents.
Documents that have no DTD are by definition not-type-valid because there is no type to vali-
date them against.
The DTD does not need to be contained inside the document. Figure 11-47 shows a cus-
tomer document in which the DTD is obtained from the file C:\inetpub\wwwroot\DBP\VRG\
DBP-e13-CustomerList.dtd. In this case, the DTD is located on the computer that stores this
document. DTDs can also be referenced by URL Web addresses. The advantage of storing the
DTD externally is that many documents can be validated against the same DTD.
The creator of a DTD is free to choose any elements he or she wants. Hence, XML docu-
ments can be extended, but in a standardized and controlled way.
Materializing XML Documents with XSLT
The XML document shown in Figure 11-46 shows both the document's structure and content.
Nothing in the document, however, indicates how it is to be materialized. The designers of
XML created a clean separation among structure, content, and format. The most popular
way to materialize XML documents is to use Extensible Style Language: Transformations
(XSLT) . XSLT is a powerful and robust transformation language. It can be used to materialize
XML documents into HTML, and it can be used for many other purposes as well.
"[POYHUVLRQ HQFRGLQJ 87)"!
'2&7<3(&XVWRPHU/LVW6<67(0&?LQHWSXE?ZZZURRW?'%3?95*?'%3H&XVWRPHU/LVWGWG!
&XVWRPHU/LVW !
&XVWRPHU !
&XVWRPHU1DPH !
)LUVW1DPH ! 'DYLG )LUVW1DPH ! !
/DVW1DPH ! 6PLWK /DVW1DPH ! !
&XVWRPHU1DPH !
$GGUHVV !
6WUHHW ! 7XPEOHZHHG/DQH 6WUHHW ! !
&LW\ ! 'XUDQJR &LW\ ! !
6WDWH ! &2 6WDWH ! !
=LS ! =LS ! !
$GGUHVV !
&XVWRPHU !
&XVWRPHU/LVW !
Figure 11-47
XML Document with
External DtD
 
Search WWH ::




Custom Search