Information Technology Reference
In-Depth Information
Attribute values must always be quoted. XML elements can have attributes in name/
value pairs just like in HTML. An element can optionally contain one or more at-
tributes . In XML, the attribute value must always be quoted. An attribute is a name-
value pair separated by an equal sign (=). An example of XML document is:
<?xml version=“1.0”?>
<note>
<to>Tan Siew Teng</to>
<from>Lee Sim Wee</from>
<heading>Reminder</heading>
<body>Don't forget the Golf Championship this weekend!</body>
</note>
The first line in the document: The XML declaration must be included. It defines the
XML version of the document. In this case the document conforms to the 1.0 speci-
fication of XML. <?xml version=“1.0”?> The next line defines the first element of
the document (the root element): <note>.
The next lines defines four child elements of the root (to, from, heading, and
body):
The last line defines the end of the root element:
A typical XML system is as shown in Fig. 2.10 .
1. XML Document (content)
2. XML Document Type Definition—DTD (structure definition; this is an opera-
tional part)
3. XML Parser (conformity checker)
4. XML Application (uses the output of the Parser to achieve your unique objectives)
Search WWH ::




Custom Search