HTML and CSS Reference
In-Depth Information
Uses of XML
XML is not limited to
use in Web databases.
There are over a hundred
industries using some form
of XML, ranging from
accounting and finance to
Table 12-2 Real-World Uses of XML
Description of Extended Markup Languages
Define databases
Use labels and fields to store and display data in a variety of ways
Give structure to documents
Provide structure to elements in topics and plays, such as indexes or scene directions
Provide Web services
Execute Web services (functions) over a network with the Simple Object Access
Protocol (SOAP) and Web Services Description Language (WSDL)
Exchange financial information
Exchange information among various applications using Open Financial
Exchange (OFX)
Store voice scripts
Store voice mail messages or regular daily messages
Annotate maps
Add place marks, shapes, and paths to a map using Keyhole Markup Language
(KML), an XML markup language
Format mathematical formulas
Format math and science content markup with MathML
Define standard document
format for businesses
Allow business partners to share a standard library of XML business documents,
such as purchase orders and invoices; identify the documents exchanged in a
particular context using Universal Business Language (UBL)
Create Web pages that are
valid XML
Transition to XHTML following XML standards and tools
Edit open source documents
Open Document Format (ODF) is a file format for word processing, spreadsheets,
and presentation software
Display electronic texts
Use XHTML and XML to display contents of eBooks and ePub devices
Syntax Rules
XML documents must be well-formed to be processed by an application. For an
XML document to be well-formed , it must adhere to the basic syntax rules for XML,
as listed in Table 12-3. Before an XML document is displayed in an application, the
document must be parsed. A parser is an XML processor that verifies the document
follows the syntax rules for a well-formed document and converts the document into
a tree of elements. Most modern Web browsers contain XML parsers. For more
information on XML syntax, see the XML Quick Reference in Appendix H.
Purpose of the XML
The XML parser is necessary
to create, read, update,
or manipulate an XML
document. Most modern
Web browsers contain
various parsers for scripting
languages and XML.
Generic Identiier
An element consists of
tags based on names that
a developer provides or
defines. The name that
a developer provides
for the tags is called the
generic identifier ( GI ).
When choosing generic
identifiers to name
document elements, a
developer must follow two
simple rules: (1) The name
must begin with a letter
or underscore (_) and may
contain letters, numbers,
periods, hyphens, or
underscores; and
(2) a prefix of XML or the
use of colons is reserved
for future, anticipated
Table 12-3 XML Syntax Rules
XML is case sensitive.
Use any case — uppercase, lowercase, or
mixed — but be consistent.
Correct: <Root></Root> or
<root></root> or
Incorrect: <Root></ROOT>
All tags must have a
closing tag.
All tags, including empty tags, must have a
closing tag. Empty tags are allowed a special
form. Empty tags have no content, such as <br>
and <img> tags.
<p>This is a paragraph</p>
<br />
All documents must have
a root element.
Include the root or start tag that begins a
Elements must be nested.
Elements cannot stand alone unless they are the
only root element.
Attribute values
must be enclosed in
quotation marks.
Use single or double quotation marks, but be
<Image picture="icon.jpg" />
With XML, white space is
Spaces between words within tags are preserved.
No need for ASCII characters
(&nbsp;) to add spaces
Search WWH ::

Custom Search