About XML
XML
Extensible Markup Language [XML] is a extensible, portable, and
structured text format.
XML is plays an important role in the exchange of various types
of data on the Web and between different applications.
It provides a standard and common data structure for sharing data
between disparate systems. Additionally, XML has built-in data validation,
which guarantees that the structure of the data that is received
is valid.
Related XML Standards
XML has a number of related standards:
XSL—Extensible Stylesheet language - used to transform XML
data into a customizable presentation.
XLink and XQuery - provide a way to provide flexible query facilities
to extract data from real and virtual XML documents on the Web.
XPath and XPointer - languages for addressing parts of an XML document.
XML Schema
XML Schema is one of the key components of XML.
Schemas provide a means of defining the structure, content, and
semantics of XML documents that can be shared between different
types of computers and documents.
XML Schemas provides a means of creating a set of rules that can
be used to identify document rules governing the validity of the
XML documents that you create.
The XML Schema specification plays an important role in the design
and implementation of Web Services. WSDL
files are also built using XML Schema as the underlying syntax.
Using XML
Using XML requires creating XML documents and consuming XML documents.
- Creating an XML document is done using editors and tools.
- Consuming XML documents involves parsing the XML documents and
extracting the useful data.
Creating XML Documents
Creating XML documents is a two step process:
- Defining the grammar and restrictions over data for the XML
document.
- Creating the XML document itself and validating the grammar
DTD and Schema.
DTD and schema are used to specify the structure of instance documents
and the datatype of each element/attribute.
XML Schema is approved by W3C Recommendation and is now being widely
used for structuring XML documents for e-commerce and Web Services
applications.
The design of the XML Schema standard focused on:
- Expressing Object Oriented design principles found in common
OO programming languages into the specification.
- Providing rich datatyping support similar to the datatyping
functionality available in most relational database systems.
XML Tags
XML uses the "<> </>" tags used in HTML.
The two primary building blocks of XML are elements and attributes.
Elements
Elements are tags that have values, and are structured as a tree.
Thus elements organized in a hierarchical fashion with a 'parent'
element and 'child' elements. For example the parent tag <employee>
may have a child tag <phone> , which in turn may also have
child tages <office> and <mobile>.
The characteristics of Elements are:
Can contain data - such as <number>
Can contain attributes
Can contain both data and attributes.
Elements must be constructed in accordance to set rules, such as
valid names, proper nesting etc.
Attributes
Attributes give more meaning to an element and describe it more
clearly.
For example <shift> element has an attribute "id"
with values "counter" and "help_desk". These
attributes define that an employee can be working at a counter or
help desk. The core purpose of attributes is to provide more information
about the element and should not be used to contain the data itself.
Just as with elements, attributes have many rules associated with
them.
Back To Top
|