RSS Feed

XML HTML and QTP Part1

Posted on

With this, I am starting a series of post on QTP and XML. To set the tone for discussion, I would start with the basics of XML and the differences between XML and HTML.

What is XML?

XML is a markup language much like HTML. The prime use of XML is to store, carry, and exchange data. Being hardware and software-independent, XML has been widely accepted (W3C standard) as the means of data exchange between disparate systems.

XML does not really do anything – it only structures, stores or sends information.

For example, this is a note stored as XML:

  1. <note>
  2. <to>tpudota.wordpress.com</to>
  3. <from>Thomas Vinod</from>
  4. <heading>XML</heading>
  5. <body>XML and QTP</body>
  6. </note>

The note has a header and a message body, sender and receiver information. Nevertheless, this XML document is nothing other than well-formed data. Someone must write a piece of software to send, receive, display or interpret it.

Software that can handle plain text can also handle XML. In a simple text editor, the XML tags will be visible. In an XML-aware application however, the XML tags can be handled specially (may or may not be visible, or have a functional meaning).

XML vs HTML :

HTML describes presentation. It is used to display data and focuses on how data looks. For example, in the HTML below, Bibliography is the header, the rest of the text is in paragraphs with the text with <i>..</i> is italicized.

  1. <h1> Bibliography </h1>
  2. <p> <i> Foundations of Databases </i>
  3. Abiteboul, Hull, Vianu
  4. Addison Wesley, 1995
  5. <p> <i> Data on the Web </i>
  6. Abiteoul, Buneman, Suciu
  7. Morgan Kaufmann, 1999

XML describes content. It is used to describe data and focuses on what data is.
For example, in the XML below, bibliography is an element with child element books.

  1. <bibliography>
  2. <book> <title> Foundations… </title>
  3. <author> Abiteboul </author>
  4. <author> Hull </author>
  5. <author> Vianu </author>
  6. <publisher> Addison Wesley </publisher>
  7. <year> 1995 </year>
  8. </book>
  9.  </bibliography>

HTML can also use XML for storing its data and concentrate on the presentation, so that changes to data do not affect the HTML. In that sense, XML is a complement to HTML, it is not a replacement for it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: