XML Weather Demo

This page uses the Microsoft® C++ and Java XML Parsers from script to parse an XML weather file. The script then populates the state and city drop-down lists and updates the table as you select different states and cities. The XML fragment for a given city is shown on the right-hand side of the table.

You can also select which XML parser to use:


Select which state to view:

Select which city to view:

' +


Notes: This nice thing about this demo is that most of the script code is identical for both parsers. The only script code that differs is the code that selects the different parsers. This is because the XML object model that the two parsers emit is the same.

The only real difference between the two parsers is that the C++ parser supports asynchronous loading of the XML (which is needed for large XML documents), and the Java parser supports full DTD validation.

The demo uses the following external files:

  • WeatherReport.xml -- The XML describing the weather.
  • WeatherReport.dtd -- The DTD that the XML points to. Currently only the Java parser processes this DTD. You can download this demo and try changing the DTD or the XML to test the Java parser validation. Validation is useful in this case, since the script code makes many assumptions about the format of the data.

HomeBack to the XML Parser home page.

© 1997 Microsoft Corporation. All rights reserved. Terms of use.