i have gon through w3school about xml. i know what it is ext.but still not able to get idea how it is useful and anybody show the website example to show how xml is useful.thanks

Dani AI

Generated

A quick, practical picture that builds on the replies from , , and :

XML is a plain-text way to describe hierarchical or document-like data so different programs can agree on structure and meaning. Where it shines is when you need formal structure and strong typing (schemas), support for mixed text + metadata (documents, not just records), and namespace isolation so different vocabularies can coexist. That explains real-world uses such as office formats, vector graphics, signed documents and many enterprise message formats.

Concrete points missing from the earlier posts:

  • Use a schema (XSD or Relax NG) to validate incoming files early; that prevents many integration bugs. See the W3C XML Schema documents for details (W3C XML Schema).
  • Use namespaces to avoid name collisions when combining vocabularies (important in SOAP/WSDL/SAML-style systems).
  • For large files prefer streaming parsers (SAX/StAX) to avoid loading the whole tree into memory; for smaller docs a DOM-style parser is simpler.
  • Query and transform with XPath/XQuery and with template-based transforms when you need different views for different devices (the device example mentioned).

When to pick XML vs alternatives: choose XML for document-centric data, strict schema needs, or where standard XML tooling (signatures, canonicalization, transforms) is required. For lightweight REST APIs and simple data payloads JSON is usually smaller and easier.

Quick workflow to apply right away: design a schema -> validate producers and consumers against it -> pick a parser strategy (stream vs tree) -> map to objects or use XPath/XQuery for access. For authoritative background see the W3C XML recommendation and the MDN XML overview (W3C XML 1.0, MDN XML overview).

Recommended Answers

All 3 Replies

i have gon through w3school about xml. i know what it is ext.but still not able to get idea how it is useful and anybody show the website example to show how xml is useful.thanks

The best example is that XML can store data, or distribute data. Much like a database, you can create your own fields and records, and most of all, it's not propriatery, therefore, you don't need specific programs to read it or write it. Try RSS, that's a good example of XML.
http://en.wikipedia.org/wiki/Rss
http://en.wikipedia.org/wiki/XML

i have gon through w3school about xml. i know what it is ext.but still not able to get idea how it is useful and anybody show the website example to show how xml is useful.thanks

It's useful if you want to store data with ten times the space and three times the verbosity you need. It's also useful if you want to transform your data with XSLT into other XML documents, but this time with twenty times the verbosity you'd get in any other language. XML is useful since it's simple and there are XML parsing libraries lying around waiting for you to use them, in many programming languages. Never mind that handy facilities for parsing and manipulating hierarchal expressions were built into Lisp more than a quarter century ago...

As a standard way of formatting data, it's best used for communication between foreign programs, and perhaps for human-readable configuration files. But it's not good to use an XML document as if it were a database, unless you enjoy slowing your computer down.

Hi..arya..

HTML can only be used to display data in computer browsers....think of a situation where you have to display the same data in a Palm Top !!!!!

So if you use XML there instead of HTML ...your new device will be able to understand it..

I hope it helps....

Rajesh C Medackel. TVM, India

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.