Explain about Basic XML.
https://www.computersprofessor.com/2016/06/explain-about-basic-xml.html
XML–Extensible markup language, XML
is a markup language to construct cross environment compatible data.
XML
data is – operating system, hardware language & computer architecture
independent.
These
features makes XML data as cross environment compatible data. XML data is constructed through tags and attributes.
Difference between XML
and HTML :
1.Both are Mark up languages because they use tags.
2.HTML concentrates on the process
to present data and used to design web
pages of websites .
3.In
HTML all tags
are predefined tags.
4.XML
is used to construct
the data and to describe
the data .It is not suitable
for designing web Pages .
5.In XML
all tags are uses defined
and pre defined .
6.XML
is complement to HTML
but not the replacement of HTML.
7. XML file’s
data is formatted data.
8. Data in text file’s
does not show relationship
between values and no data
hierarchy.
9. Data of the XML files
show relation ship between values and follow data hierarchy.
valid (or) well
formed :
XML
documents may be either valid (or)
well formed . The XML document
that satisfies syntax
rules and naming rules is
called well formed XML
document .
XML
engine (or) XML parses is required to check whether
XML document is well formed (or) not
XML document that
satisfies syntax rules, naming,
rule and DTD/ schema rules is
called‘ Valid XML
document’.
Syntax rules:
Every opening tag
should have closing tag.
sub tag must be nested properly.
You should not keep
any tag after closing the loot element.
XML tag name and
attribute name are case sensitive .
Naming Rules :
Tag name must
start with alphabet.
Other than first character of tag name can be alphabet,
digit, - , underscore (-) but other special characters are not allowed.
HTML tag name and attribute name are case sensitive.
White space characters are not
allowed.
XML Elements:-
XML document are composed of three things:
1) Elements
2) Control information
3) Entities.
Elements:- Each document has a single root element which
contain all of the other markup.
Nesting tag:- Event
the simplest document has nested tags unlike HTML these must be nested properly
and closed in the reverse of the order in which they are opened.
Case sensitive:- In HTML we
use mixed upper case and lower case inside markup. XML is case sensitive and
you must use lower case for markup.
In HTML < img src = “c:\document\il.jpg” height = “120” Width = “30”>- - - - </img>
In XML this tag will be written as
<img>
<src> “C:\document\il.jpg” </src>
<height> 120 </height>
<width> 30 </width>
</img>
Control Information:- Control
structures are
comment
document type
processing instruction declaration
Comment:- <! – – comment
text – – >
Processing instruction:- The
instruction tells the application that the data in the file follow the rules of
XML version 1.0.
<
? XML version = “1.0”? >
Entities:- The final part of
the XML may be one (or) more entities. Entity is a thing which is to be used as
a part of the document. Example of an entity is image (or) encrypted signature
etc.,
Syntax: > – >
< – <
Eg:- <msg> 10 >15 </msg>
< msg> 10 & gt; 15 </msg>
