Creating a XSD

  1. Format Document

  2. Hmm, what about namespaces?

  3. elementFormDefault="qualified"

  4. Add an element declaration:

    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema"
    	targetNamespace="http://namespaces.cafeconleche.org/birds/"
    	xmlns:tns="http://namespaces.cafeconleche.org/birds/"
    	elementFormDefault="qualified">
    	
    	<element name="daylist">
    	  <complexType>
    		<sequence>
    		
    		</sequence>
    	  </complexType>
    	</element>
    	
    	
    </schema>

  5. Unlike DTDs errors are noted dynamically

  6. Set document to validate against schema (comment out DOCTYPE and notice how "too smart" the comment autocomplete is):

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://namespaces.cafeconleche.org/birds/ daylist.xsd"


Previous | Next | Top | Cafe con Leche

Copyright 2005 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified August 29, 2005