a minimal well-formed XML document;
<welcome>Welcome to ICTP in Trieste!</welcome> |
this document can be made valid by adding a DTD:
<?xml version="1.0" standalone="yes"?> <!DOCTYPE welcome [ <!ELEMENT welcome (#PCDATA)> ]> <welcome>Welcome to ICTP in Trieste!</welcome> |
This document has three parts:
an XML processing instruction (version, encoding, stand-alone or no);
a document type declaration (internal and external subsets);
the document instance.
We now want to feed our document to a few XML parsers and also have them analyse the structure of the document.
>aelfred.sh welcome.xml
Start document
Resolving entity: pubid=null, sysid=file:/user/goossens/welcome.xml
Starting external entity: file:/user/goossens/welcome.xml
Doctype declaration: welcome, pubid=null, sysid=null
Start element: name=welcome
Character data: "Welcome to ICTP in Trieste!"
End element: welcome
Ending external entity: file:/user/goossens/welcome.xml
End document
>nsgmls xml.dcl welcome.xml
?xml version="1.0" standalone="yes"
(welcome
-Welcome to ICTP in Trieste!
)welcome
C
>xt.sh welcome.xml showtree.xsl
SHOWTREE Stylesheet - http://www.CraneSoftwrights.com/resources/
Root:
1 Element 'welcome' ():
1.1 Text (welcome): {Welcome to ICTP in Trieste!}
|
![]() | ![]() ![]() | ![]() |