XML Tutorials

  Home arrow XML Tutorials arrow Page 2 - Getting to Know XML
XML TUTORIALS

Getting to Know XML
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 6
    2009-02-04

    Table of Contents:
  • Getting to Know XML
  • More Definitions
  • Determining the Form of Your Data
  • Different Types of XML

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Getting to Know XML - More Definitions


    (Page 2 of 4 )

    Metalanguage 

    A metalanguage is a language you use to give more information about another language. SGML and XML are both metalanguages in that you can use them to give information about other markup languages, such as HTML and XHTML. 

    Nesting  

    When I mentioned root, parent, and child architecture before, I was referring to nesting. In its most basic sense, nesting is the way your order your elements, opening and closing your child element prior to closing you parent element. 

    In XML, you nest your child elements in your parent elements. In this way, your child element becomes part of your parent element. Here is an example: 

    <car> Mazda <type> Coupe</type> </car> 

    In the preceding example, <car> is the parent and <type> is the child. As you can see, you must close the child element </type> and THEN close the parent element </car>. 

    Syntax  

    Syntax acts as the rule that decides how you construct your statements in markup languages. An example of syntax would be that your elements must have an open and close tag. We will talk about this further in a later article. 

    Tag 

    A tag is a markup that is used to enclose an element's content, such as <car> Mazda </car>. If your element contains no content whatsoever, it only requires a single tag. If your element does contain content, then it needs an opening and a closing tag. Consider the example below, borrowed from an earlier example and modified to fit this situation: 

    <car> Mazda </car>

    <salesperson> Carl Fredericks </salesperson>

    <commissiontype>

    <salesdate> 10/22/2008 </salesdate> 

    In the preceding example, <car>, <salesperson>, and <salesdate> are all regular elements containing content, and therefore must have open and close tags. <Commissiontype>, however, holds no content, and therefore only requires the open tag <commissiontype>. 

    Valid  

    If a document follows the rules set forth in a DTD (Document Type Definition) or a Schema document, then it is considered a valid document. 

    Well Formed  

    If a markup-language document follows the syntax rules of XML, then it is well formed. 

    XML Schema 

    A statement of rules that dictates how an XML document should model data and how it should define elements, objects, attributes, properties, and any relationships that exist between elements. 

    More XML Tutorials Articles
    More By James Payne

    blog comments powered by Disqus

    XML TUTORIALS ARTICLES

    - Validation with Document Type Definitions (D...
    - Creating a Well-Formed XML Document
    - Getting to Know XML
    - A Friendly Approach to XML
    - Creating RSS 2.0 Feeds
    - Using Modules in Your RSS Feed
    - RSS 2.0
    - Querying XML: Use Cases
    - Joins and Query Use with XML
    - Solving Problems by Querying XML
    - Performing Set Operations When Querying XML
    - Querying XML
    - Handling Data for Ajax with JSON
    - Handling XML Data for Ajax
    - XML and JSON for Ajax


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 1 - Follow our Sitemap