A Schema for a Document that uses Namespaces

<?xml version="1.0"?>
<element xmlns="http://relaxng.org/ns/structure/1.0"
         name="SONG" 
         ns="http://www.cafeconleche.org/namespace/song">
  <element name="TITLE">
    <text/>
  </element>
  <element name="PHOTO">
    <attribute name="ALT">
      <text/>
    </attribute>
    <attribute name="WIDTH">
      <text/>
    </attribute>
    <attribute name="HEIGHT">
      <text/>
    </attribute>
  </element>
  <oneOrMore>
    <element name="COMPOSER">
      <text/>
    </element>
  </oneOrMore>
  <zeroOrMore>
    <element name="PRODUCER">
      <text/>
    </element>
  </zeroOrMore>
  <optional>
    <element name="PUBLISHER">
      <text/>
    </element>
  </optional>
  <optional>
    <element name="LENGTH">
      <text/>
    </element>
  </optional>
  <optional>
    <element name="YEAR">
      <text/>
    </element>
  </optional>
  <oneOrMore>
    <element name="ARTIST">
      <text/>
    </element>
  </oneOrMore>
</element>

default namespace = "http://www.cafeconleche.org/namespace/song"

element SONG {
  element TITLE { text },
  element PHOTO {
    attribute ALT    { text },
    attribute WIDTH  { text },
    attribute HEIGHT { text }
  },
  element COMPOSER  { text }+,
  element PRODUCER  { text }*,
  element PUBLISHER { text }?,
  element LENGTH    { text }?,
  element YEAR      { text }?,
  element ARTIST    { text }+
}

Previous | Next | Top | Cafe con Leche

Copyright 2005-2007 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified October 25, 2004