Herong's Tutorial Notes On XML Technologies
Dr. Herong Yang, Version 3.04

XML Browsers

This tutorial describes:

  • Using Internet Explorer as an XML Browser
  • Using Internet Explorer as an XML Syntax Checker
  • Other XML Browsers

Using Internet Explorer as an XML Browser

Microsoft Internet Explorer (IE) 6.0 can be used as an XML broswer. Run IE, and open glossary.xml with the File memu, you will the following in the IE window:

  <?xml version="1.0" ?> 
- <!-- 
      dictionary.xml
          Copyright (c) 2002 by Dr. Herong Yang
  --> 
- <dictionary>
  - <word acronym="true">
      <name>XML</name> 
      <definition referenece="Herong's Notes">eXtensible Markup ...
      <update date="2002-12-23" /> 
    </word>
  - <word symbol="true">
      <name><</name> 
      <definition>Mathematical symbol representing the "less than" ...
    - <definition>
        Reserved symbol in XML to representing the beginning of tags, ...
      - <![CDATA[ <p>Hello world!</p> ]]>
      </definition>
    </word>
  </dictionary>

Note that:

  • Different colors are used for comments, element tags and contents, and attribute names and values. Colors were not captured in the above output.
  • Elements that have nested child elements are prefixed with "-" or "+".
  • "-" or "+" can be clicked to expand or collapse the sub-elements of a nested element.
  • White spaces, and element ending tags are re-organized.
  • XML entities are substituted by the characters they are representing.
  • Characters in the CDATA section are preserved as they are.

Using Internet Explorer as an XML Syntax Checker

Microsoft Internet Explorer (IE) 6.0 can also be used as an XML syntax checker.

Look at the following XML file, incorrect.xml

<?xml version="1.0"?>
<!-- incorrect.xml
     Copyright (c) 2002 by Dr. Herong Yang
-->
<dictionary>
 <word>
  <update date="2002-12-23"/>
  <name is_acronym="true">XML</Name>
  <description>eXtensible Markup Language</description>
 </word>
 <word>
  <update date="2002-12-23"/>
  <name is_acronym="true">POP</name>
  <definition default>Post Office Protocol</definition>
  <definition>Point Of Purchase</definition>
</dictionary>

Do you know how many syntax errors are in this XML file?

If you open incorrect.xml with IE, you will see this:

The XML page cannot be displayed 
Cannot view XML input using XSL style sheet. Please correct the error
and then click the Refresh button, or try again later. 
------------------------------------------------------------------------

End tag 'Name' does not match the start tag 'name'. 
Error processing resource 'file:///C:/herong/incorrect.xml'. 
Line 8, Position 32 

  <name is_acronym="true">XML</Name>
-------------------------------^

This is almost perfect.

  • It tells you what is the error: "End tag 'Term does not match the start tag 'term'." Remember element tags are case sensitive.
  • It also tells you where is the error: "Line 7, Position 14".
  • But it only tells the first error. To see the other errors you must correct the first one, and re-open the file again in IE.

Exercise: Fix all the syntax errors in incorrect.xml.

Other XML Browsers

  • MS IE 6.0 from www.microsoft.com: Browser.
  • XML Spy from www.altova.com: Browser and editor.
Dr. Herong Yang, updated in 2006
Herong's Tutorial Notes On XML Technologies - XML Browsers