When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles [1.x] [2.0]
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips
Search

Sections:
Book Reviews
Sample Chapters
Commonly Asked Message Board Questions
Headlines from ASPWire.com
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
Web Hosts
XML Info
Information:
Advertise
Feedback
Author an Article
Technology Jobs

















internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
ASP ASP.NET ASP FAQs Message Board Feedback ASP Jobs
Print this page.

Windows Systems Administrator
Jupitermedia
US-CT-Darien

Justtechjobs.com Post A Job | Post A Resume

Published: Wednesday, May 10, 2000

Getting Started with XML


Chances are you've heard of XML sometime in the past. For about the past year Microsoft has been saying, "XML-this" and "XML-that." This article is intended for those who are brand-spankin' new to XML and are interested in learning what all the buzz is about!

- continued -

Imagine that you ran an eCommerce site that sold widgets. Through your Web site, users could interact with the Widget Database, seeing real-time information on the widget stock, widget availability, and other relevant information. Being an industrious Widget-retailer, you'd like to be able to offer other Web sites to showcase your Widgets. For example, a Widget-information Web site might be interested in listing the widgets that your company currently had in stock.

Providing such a mechanism is not easy. Ideally, you would want to let this Widget Information site be able to access your Widget database directly, grabbing the needed information. However, perhaps you only want to provide a few tidbits of information and keep the rest secret? Offering database access would not be the best solution. Enter a better solution: XML.

XML, which stands for EXtensible Markup Language, is a means by which data can be stored in an easy to read, textual implementation. XML uses a tag-based implementation similar to HTML. However, unlike HTML, there are no predefined XML tags. The creator of an XML file must define his or her own tags, deciding how these tags describe the data they represent.

XML is a bit more stringent about closing tags than HTML. For example, in HTML, a single tag, like <BR> is acceptable. In XML, however, all tags must have an opening and closing tag, with the data they represent inbetween. XML tags are also case-sensitive.

In our Widget Web Site example, for those widget-information Web sites we might want to provide the following bits of information on all of our widgets:

  • Name
  • Product Number
  • Cost
  • Description

This information could be represented by the following XML document:

<?xml version="1.0"?>
<widgets>
  <widget>
    <name>Widget Name</name>
    <productNumber>Widget Product Number</productNumber>
    <cost>Widget Cost</cost>
    <description>Widget Description</description>
  </widget>
</widgets>

Note that for each widget in the database one of these entries would exist. The actual name, cost, product number, and description of each widget would go in the italicized text areas. Also note the first line, <?xml version="1.0"?>. This line identifies that the document is an XML document, specifically a version 1.0 XML document.

Think of XML as a verbose description of a database table. In our above example, the XML represents a table named widgets. Each row of the table is represented by a widget tag. Each widget row contains four columns: name, productNumber, cost, and description. So, if our Widget Database contained two widgets, our XML document might look like:

<?xml version="1.0"?>
<widgets>
  <widget>
    <name>Oblong Widget</name>
    <productNumber>3432341-12312</productNumber>
    <cost>45.50</cost>
    <description>This widget is useful for jobs requiring
                       oblong tools.</description>
  </widget>

  <widget>
    <name>Skinny Widget</name>
    <productNumber>34323341-1F11</productNumber>
    <cost>55.75</cost>
    <description>This widget is useful for jobs requiring
                       skinny tools.</description>
  </widget>
</widgets>

Save this XML file in your Web directory: /widget.xml.

In Part 2 we'll look at how to iterate through this XML document via an ASP page. Note that in our Widget Database Example, this XML file could be generated each day or on the fly from the Widget Database Web site.

  • Read Part 2


    Windows Internet Technology | ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article



  • JupiterOnlineMedia

    internet.comearthweb.comDevx.commediabistro.comGraphics.com

    Search:

    Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

    Jupitermedia Corporate Info


    Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

    Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

    Solutions
    Whitepapers and eBooks
    Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
    Microsoft Article: 7.0, Microsoft's Lucky Version?
    Microsoft Article: Hyper-V--The Killer Feature in Windows Server 2008
    Avaya Article: How to Feed Data into the Avaya Event Processor
    Microsoft Article: Install What You Need with Windows Server 2008
    HP eBook: Putting the Green into IT
    Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
    Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
    Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
    Avaya Article: Setting Up a SIP A/S Development Environment
    IBM Article: How Cool Is Your Data Center?
    Microsoft Article: Managing Virtual Machines with Microsoft System Center
    HP eBook: Storage Networking , Part 1
    Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
    MORE WHITEPAPERS, EBOOKS, AND ARTICLES
    Webcasts
    Intel Video: Are Multi-core Processors Here to Stay?
    On-Demand Webcast: Five Virtualization Trends to Watch
    HP Video: Page Cost Calculator
    Intel Video: APIs for Parallel Programming
    HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
    Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
    MORE WEBCASTS, PODCASTS, AND VIDEOS
    Downloads and eKits
    Sun Download: Solaris 8 Migration Assistant
    Sybase Download: SQL Anywhere Developer Edition
    Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
    Red Gate Download: SQL Compare Pro 6
    Iron Speed Designer Application Generator
    MORE DOWNLOADS, EKITS, AND FREE TRIALS
    Tutorials and Demos
    How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
    eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
    IBM Article: Collaborating in the High-Performance Workplace
    HP Demo: StorageWorks EVA4400
    Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
    Microsoft How-to Article: Get Going with Silverlight and Windows Live
    MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES