XML
  Home arrow XML arrow Page 2 - An Introduction to XML Schemas
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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

An Introduction to XML Schemas
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 12
    2004-11-03

    Table of Contents:
  • An Introduction to XML Schemas
  • Choose Your Schema
  • Element Declarations
  • Definitions and Elements
  • The Complete File
  • Validating a Document
  • A Few Final Tips

  • 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


    An Introduction to XML Schemas - Choose Your Schema


    (Page 2 of 7 )

    There are actually quite a few different Schema specifications to choose from, but for maximum compatibility and support, the W3C recommendation should be used. If you’re familiar with XML, you’ll know that you don’t always need to use a DTD or a Schema to make a well formed XML document, but if you want to share information with somebody else, it’s best to use a Schema or DTD to make sure you are giving each other the correct data in the correct format. Additionally, if you are producing XML documents that contain a lot of data, it’s good to have a Schema or DTD to validate the documents with to ensure consistency and validity.

    The great thing about XML is that you can create your own mark-up tags. This is all well and good, but what if you give an element the same name that someone else has given an element in their own XML vocabulary? How do you create uniqueness between the two documents that transcends naming conventions? The answer is namespaces, which act as a unique identifier to schemas. This is achieved by targeting the namespace in your schema and using a prefix before your element declarations. 

    The namespace used is part of the XML declaration at the beginning of your schema document. Because XML schema documents are essentially XML documents, they must begin with the XML declaration:

    <?xml version=”1.0”?>

    Directly after this needs to come the namespace declaration:

    <xsd:schema xmlns:xsd=http://www.w3.org/2001/XMLSchema>

    More XML Articles
    More By Dan Wellman


       · Hi,On page 3 of 7,...
       · Thanks for pointing that one out, a small error but one that will no doubt have...
     

    XML ARTICLES

    - Using Regions with XSL Formatting Objects
    - Using XSL Formatting Objects
    - More Schematron Features
    - Schematron Patterns and Validation
    - Using Schematron
    - Datatypes and More in RELAX NG
    - Providing Options in RELAX NG
    - An Introduction to RELAX NG
    - Path, Predicates, and XQuery
    - Using Predicates with XQuery
    - Navigating Input Documents Using Paths
    - XML Basics
    - Introduction to XPath
    - Simple Web Syndication with RSS 2.0
    - Java UI Design with an IDE







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek