newbie:importance of XML?

V

Vishnu

Hello guys

I have been reading about XML for the past few days,but i needed some
clarification as to the importance of XML.From what i understood:

* XML is a way to organize data and manipulate on it.There are other
things like XSL which helps to display it in any format.
* XML has got broad acceptance as a standard which is one of the
reasons why its so popular.

But what i dont understand is:

* Most of the articles i read says XML helps us to define new
languages.Can someone explain me how XML does this and also some
practical examples?

* Is XML just another way to organize data?Because if this was the
case,then one could have send some data in .txt format to the
receiver.If receivcer can interpret this data,then all is done.And if
this 'sending of .txt data' is made uniform throughout,then we have
got a universal way to send and organize data,right?What iam asking
is:IS THIS XML'S LOGIC?

* One more query on sending of data.I read xml data can be send to any
devices provided it gives support.But when you have say,10000
data,then the XML file would be very large right?What advantage you
get by sending data in xml format[other than interoperatability]?

Iam sorry if the question is irrevelant.But i will be very thankful to
you if you can give me some basic information regarding these
questions.

--Vishnu--
 
P

Patrick TJ McPhee

[...]


% * Most of the articles i read says XML helps us to define new
% languages.Can someone explain me how XML does this and also some
% practical examples?

What XML _is_ is a language for defining data mark-up languages. When
people go on and on and on about XML, they're often talking about
some language which has been defined using XML (the rest of the time,
they're mostly just filling the void with nonsense). Languages defined
in XML have a number of common characteristics, the most obvious of which
are

- they divide data into named units called elements
- elments can have content, which can consist of text data and other
elements
- elements can have named bits of data, called attributes
- the way the data is marked up (i.e., how elements are written
in a file, how comments are written, how special characters are
escaped) is the same for all XML documents

XML provides two benefits: it reduces the work to define new languages,
and it reduces the work to write language processing software. To define
a new language, it's sufficient to define its structure, that is, the
names of the elements and the way they nest together. The precise syntax
of the language follows from that directly. It means you can define a
new XML language in a few lines: the document element is `config-file'.
It has one repeated child element, `item', which has one required
attribute `name'. From that, you know

<config-file>
<item name='root-dir'>/usr/home/ptjm</item>
<item name='default-emoticon'><![CDATA[<:)]]</item>
</config-file>

is a valid document according to this new language. On the processing side,
the same software can be used to convert any XML file into data structures,
so you don't need to write a parser for each new language you want to use.
In some cases (for instance, in an editor), the processing to be performed
can be inferred from the document structure, so the same piece of code can
be used to completely process any XML file. In other cases, XML helps with
one small piece of the application, but doesn't appreciably reduce the
effort to produce an application as a whole.

% case,then one could have send some data in .txt format to the
% receiver.If receivcer can interpret this data,then all is done.

Sure. The question is how to define the .txt format. I use a simple
configuration file format above because it's quick to define, but in
that case, it would be just as easy for me to say `use windows .ini
format with this section name and these parameter names' or `use X
resource file format with these resource names', or `use a tab-delimited
file with the configuration item name in the first field and the
value taking up the rest of the line. For a format with any degree of
complexity, the syntactic conventions that XML forces on you become
a more important part of the language definition, and it becomes
easier to define the language using XML than using some ad hoc text
format.

% * One more query on sending of data.I read xml data can be send to any
% devices provided it gives support.

This is a fine example of filling the void with nonsense. You can send
PDF data to any device, provided it gives support. You can send mud
pies. You can write instructions in esperonto and any device can process
them, provided they understand esperonto.


% But when you have say,10000
% data,then the XML file would be very large right?What advantage you
% get by sending data in xml format[other than interoperatability]?

If you have a lot of data, you have a lot of data. XML does nothing
to help with this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top