XML
  Home arrow XML arrow Page 7 - XML Basics (part 1)
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
XML

XML Basics (part 1)
By: icarus, (c) Melonfire
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2001-07-23

    Table of Contents:
  • XML Basics (part 1)
  • A Little History
  • The Big Picture
  • The Hammer And The Chisel
  • Lights, Camera, Action!
  • Breaking It Down
  • Simply Element-ary
  • Anyone For Chicken?
  • To Attribute Or Not To Attribute...

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    XML Basics (part 1) - Simply Element-ary
    (Page 7 of 9 )

    The document prolog is followed by a series of "elements". An element, which is the basic unit of XML, consists of textual content (or "character data"), enhanced with descriptive tags (or "markup"). The boundaries of an element are defined by start and end tags, and may contain additional descriptive "attributes".

    Here are some examples of XML elements:

    <title>XML Basics</title> <item>Nutcracker</item> <dinosaur>Stegosaurus</dinosaur>
    XML also allows for so-called empty elements - essentially, elements which have no content and therefore do not require a closing tag. Such elements are closed by adding a slash (/) to the end of their opening tag. For example,

    <rule>Every sentence ends with a <period /></rule>
    An element name must begin with a letter, optionally followed by more letters and numbers. For example,

    <popeye> <book> <INCOME>
    are all valid element names.

    Element names are case sensitive - so

    <me>
    is different from

    <Me>
    or

    <ME>
    An element may contain only text,

    <step>Garnish with lemon and chopped onions</step>
    or a combination of text and other elements.

    <sentence>The red <animal>wolf</animal> jumped over the blue <vegetable>aubergine</vegetable></sentence>
    In order to be well-formed, an XML document must contain at least one non-empty element. This outermost element is called the "root element" and, in turn, may contain other elements, nested in a hierarchical manner. In the first example above, the root element would be <review>...</review>.

    This article copyright Melonfire 2001. All rights reserved.

    More XML Articles
    More By icarus, (c) Melonfire


     

       

    XML ARTICLES

    - How to Set Up Podcasting and Vodcasting
    - Creating an RSS Reader Application
    - Building an RSS File
    - An Introduction to XUL Part 6
    - An Introduction to XUL Part 5
    - An Introduction to XUL Part 4
    - An Introduction to XUL Part 3
    - An Introduction to XUL Part 2
    - An Introduction to XUL Part 1
    - XML Matters: Practical XML Data Design and M...
    - Practical XML Data Design and Manipulation f...
    - SimpleXML
    - XForms Basics, Part 3
    - XForms Basics, Part 2
    - XForms Basics




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway