4..lect-09 XML Languages & Applications
4..lect-09 XML Languages & Applications
APPLICATIONS
eXtensible Markup
Language
(New generation of markup languages)
CORE XML
XMLstands for EXtensible Markup
Language.
XML was designed to describe data, not to
display data like HTML
XML is a software- and hardware-independent
<note>
<to>Mr. Saif</to>
<from>IQRA COLLEGE</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!
</body>
</note>
DIFFERENCE B/W XML &
HTML
XML is not a replacement for HTML.
XML and HTML were designed with
different goals:
XML was designed to describe data, with
focus on what data is
HTML was designed to display data, with
focus on how data looks
HTML is about displaying information,
while XML is about carrying
information.
DIFFERENCE B/W XML &
HTML
With XML You Invent Your Own Tags:
The tags in the example above (like <to>
predefined tags.
The tags used in HTML are predefined.
XML version:
<?xml version="1.0" encoding="UTF-8"?>
The next line describes the root element of the
document: <Note>
The next 4 lines describe 4 child elements of the
tag:
<p>This is a paragraph. <br>
In XML, it is illegal to omit the closing tag. All elements
case:
<Message>This is incorrect</message>
<message>This is correct</message>
(03) Entity References:
Some characters have a special meaning in XML. If
an entity reference:
<message>if
Entity Refs.
salary
Symbol
< 1000
Meaning
then</message>
< < Less than
> > Greater than
& & Ampersand
' ‘ Apostrophe
" “ Quotation mark
XML SYNTAX RULES
(04) XML Elements Must be Properly Nested:
In HTML, you might see improperly nested
elements:
<b><i>This text is bold and italic</b></i>
In XML, all elements must be properly nested
quoted.
Study the two XML documents
1st One: 2nd One: below. The first one
is <note
incorrect, the second<note
date=12/11/2007> is correct:
date=“12/11/2007”>
<to>Tove</to> <to>Tove</to>
<from> Jani </form> <from> Jani </form>