Professional Documents
Culture Documents
Version 1.0
Introduction
•EXtensible Markup Language (XML) is a data
representation language by using a set of
tags.
•Unlike HTML, which supports only limited set
of tags, using XML, we can have our own
tags defined.
•XML is used to represent most of the
configuration files in J2EE application.
•Example:
<name>
<first>John</first>
<last>Doe</last>
TCS Internal September 3, 2009
Rules for well formed XML
documents
•Every start-tag must have matching end-tag
or be a self-closing tag.
– Examples: Start and End
Tag
•<name>John</name>
•<document-end /> Self closing
Tag
•Example:
– <!ELEMENT dinosaurs(carnivore, herbivore,
omnivore)>
•The content may be:
– Empty
– Element
– Mixed
– Any
TCS Internal September 3, 2009
Examples of Element Declarations:
Example 1: Elements with empty declartion
Declaration:
<!ELEMENT Bool (EMPTY)> <!--DTD declaration of empty element-->
Usage:
<Bool Value="True"></Bool> <!--Usage with attribute in XML file-->
Element Attribute
Name
When ever the parser finds ‘asap’ within the document, it will be automatically
replaced into ‘as soon as possible’.