XML First Example

In the previous chapter we have learnt the difference between the XML and HTML.In this tutorial we will be learning the simple example and the process to execute or open XML file in IE Browser.

How to Write XML file and Open it in Internet Explorer ?

  1. In order to write XML file we must have text editor.
  2. Our recommendation is to use Notepad++ for Editing and Writing XML files. ( Link : Notepad++ )
  3. Open Notepad++ and type this Code.
  1. Save this Document with .xml extension. Let Our XML file be –
  1. Open name.xml in Internet Explorer.
  2. You will be able to see your file like this –
Opening XML File in Internet Explorer

You can double click on hyphen Symbol in order to minimize Tree Structure –

Minimizing XML File

If you need sample XML then visit this link.

Sample XML :

   <book category="COOKING">
      <title lang="en">Everyday Italian</title>
      <author>Giada De Laurentiis</author>
   <book category="CHILDREN">
      <title lang="en">Harry Potter</title>
      <author>J K. Rowling</author>
   <book category="WEB">
      <title lang="en">XQuery Kick Start</title>
      <author>James McGovern</author>
      <author>Per Bothner</author>
      <author>Kurt Cagle</author>
      <author>James Linn</author>
      <author>Vaidyanathan Nagarajan</author>
   <book category="WEB">
      <title lang="en">Learning XML</title>
      <author>Erik T. Ray</author>

In the next tutorial we will be learning how to parse the document ?.