Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a2da5eab8fb68605fe995d94e514eeb0 > files > 24

cduce-0.5.3-2mdv2010.0.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>CDuce: XML Schema sample documents</title><meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type"/><link type="text/css" rel="stylesheet" href="cduce.css"/></head><body style="margin: 0; padding : 0;"><table border="0" width="100&#37;" cellspacing="10" cellpadding="0"><tr><td valign="top" align="left" style="width:20&#37;;"><div class="leftbar" id="leftbar"><div class="smallbox"><ul><li><a href="#sample">Sample XML documents</a></li><li><a href="#mails_xsd">mails.xsd</a></li><li><a href="#mails_xml">mails.xml</a></li></ul></div></div></td><td><h1>XML Schema sample documents</h1><div class="mainpanel"><div class="smallbox"><p><a href="index.html">CDuce: documentation</a>: <a href="manual.html">User's manual</a>: XML Schema sample documents</p><p><a href="manual_schema.html"><img class="icon" width="16" alt="Previous page:" height="16" src="img/left.gif"/> XML Schema</a> <a href="manual_interfacewithocaml.html"><img class="icon" width="16" alt="Next page:" height="16" src="img/right.gif"/> Interfacing CDuce with OCaml</a></p></div><div><h2><a name="sample">Sample XML documents</a></h2><p>
    All the examples you will see in the manual section regarding CDuce's XML
    Schema support are related to the XML Schema Document <b><tt>mails.xsd</tt></b>
    and to the XML Schema Instance <b><tt>mails.xml</tt></b> reported below.
  </p></div><div><h2><a name="mails_xsd">mails.xsd</a></h2><div class="code"><pre>
&lt;!-- mails.xsd --&gt;

&lt;xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;

 &lt;xsd:element name=&quot;mails&quot; type=&quot;mailsType&quot; /&gt;

 &lt;xsd:complexType name=&quot;mailsType&quot;&gt;
  &lt;xsd:sequence minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;&gt;
   &lt;xsd:element name=&quot;mail&quot; type=&quot;mailType&quot; /&gt;
  &lt;/xsd:sequence&gt;
 &lt;/xsd:complexType&gt;

 &lt;xsd:complexType name=&quot;mailType&quot;&gt;
  &lt;xsd:sequence&gt;
   &lt;xsd:element name=&quot;envelope&quot; type=&quot;envelopeType&quot; /&gt;
   &lt;xsd:element name=&quot;body&quot; type=&quot;bodyType&quot; /&gt;
   &lt;xsd:element name=&quot;attachment&quot; type=&quot;attachmentType&quot;
		minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /&gt;
  &lt;/xsd:sequence&gt;
  &lt;xsd:attribute use=&quot;required&quot; name=&quot;id&quot; type=&quot;xsd:integer&quot; /&gt;
 &lt;/xsd:complexType&gt;

 &lt;xsd:element name=&quot;header&quot;&gt;
  &lt;xsd:complexType&gt;
   &lt;xsd:simpleContent&gt;
    &lt;xsd:extension base=&quot;xsd:string&quot;&gt;
     &lt;xsd:attribute ref=&quot;name&quot; use=&quot;required&quot; /&gt;
    &lt;/xsd:extension&gt;
   &lt;/xsd:simpleContent&gt;
  &lt;/xsd:complexType&gt;
 &lt;/xsd:element&gt;

 &lt;xsd:element name=&quot;Date&quot; type=&quot;xsd:dateTime&quot; /&gt;

 &lt;xsd:complexType name=&quot;envelopeType&quot;&gt;
  &lt;xsd:sequence&gt;
   &lt;xsd:element name=&quot;From&quot; type=&quot;xsd:string&quot; /&gt;
   &lt;xsd:element name=&quot;To&quot; type=&quot;xsd:string&quot; /&gt;
   &lt;xsd:element ref=&quot;Date&quot; /&gt;
   &lt;xsd:element name=&quot;Subject&quot; type=&quot;xsd:string&quot; /&gt;
   &lt;xsd:element ref=&quot;header&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot; /&gt;
  &lt;/xsd:sequence&gt;
  &lt;xsd:attribute name=&quot;From&quot; type=&quot;xsd:string&quot; use=&quot;required&quot; /&gt;
 &lt;/xsd:complexType&gt;

 &lt;xsd:simpleType name=&quot;bodyType&quot;&gt;
  &lt;xsd:restriction base=&quot;xsd:string&quot; /&gt;
 &lt;/xsd:simpleType&gt;

 &lt;xsd:complexType name=&quot;attachmentType&quot;&gt;
  &lt;xsd:group ref=&quot;attachmentContent&quot; /&gt;
  &lt;xsd:attribute ref=&quot;name&quot; use=&quot;required&quot; /&gt;
 &lt;/xsd:complexType&gt;

 &lt;xsd:group name=&quot;attachmentContent&quot;&gt;
  &lt;xsd:sequence&gt;
   &lt;xsd:element name=&quot;mimetype&quot;&gt;
    &lt;xsd:complexType&gt;
     &lt;xsd:attributeGroup ref=&quot;mimeTypeAttributes&quot; /&gt;
    &lt;/xsd:complexType&gt;
   &lt;/xsd:element&gt;
   &lt;xsd:element name=&quot;content&quot; type=&quot;xsd:string&quot; minOccurs=&quot;0&quot; /&gt;
  &lt;/xsd:sequence&gt;
 &lt;/xsd:group&gt;

 &lt;xsd:attribute name=&quot;name&quot; type=&quot;xsd:string&quot; /&gt;

 &lt;xsd:attributeGroup name=&quot;mimeTypeAttributes&quot;&gt;
  &lt;xsd:attribute name=&quot;type&quot; type=&quot;mimeTopLevelType&quot; use=&quot;required&quot; /&gt;
  &lt;xsd:attribute name=&quot;subtype&quot; type=&quot;xsd:string&quot; use=&quot;required&quot; /&gt;
 &lt;/xsd:attributeGroup&gt;

 &lt;xsd:simpleType name=&quot;mimeTopLevelType&quot;&gt;
  &lt;xsd:restriction base=&quot;xsd:string&quot;&gt;
   &lt;xsd:enumeration value=&quot;text&quot; /&gt;
   &lt;xsd:enumeration value=&quot;multipart&quot; /&gt;
   &lt;xsd:enumeration value=&quot;application&quot; /&gt;
   &lt;xsd:enumeration value=&quot;message&quot; /&gt;
   &lt;xsd:enumeration value=&quot;image&quot; /&gt;
   &lt;xsd:enumeration value=&quot;audio&quot; /&gt;
   &lt;xsd:enumeration value=&quot;video&quot; /&gt;
  &lt;/xsd:restriction&gt;
 &lt;/xsd:simpleType&gt;

&lt;/xsd:schema&gt;
</pre></div></div><div><h2><a name="mails_xml">mails.xml</a></h2><div class="code"><pre>
&lt;!-- mails.xml --&gt;

&lt;mails&gt;
  &lt;mail id=&quot;0&quot;&gt;
    &lt;envelope From=&quot;bill@microsoft.com&quot;&gt;
      &lt;From&gt;user@unknown.domain.org&lt;/From&gt;
      &lt;To&gt;user@cduce.org&lt;/To&gt;
      &lt;Date&gt;2003-10-15T15:44:01Z&lt;/Date&gt;
      &lt;Subject&gt;I desperately need XML Schema support in CDuce&lt;/Subject&gt;
      &lt;header name=&quot;Reply-To&quot;&gt;bill@microsoft.com&lt;/header&gt;
    &lt;/envelope&gt;
    &lt;body&gt;
      As subject says, is it possible to implement it?
    &lt;/body&gt;
    &lt;attachment name=&quot;signature.doc&quot;&gt;
      &lt;mimetype type=&quot;application&quot; subtype=&quot;msword&quot;/&gt;
      &lt;content&gt;
	### removed by spamoracle ###
      &lt;/content&gt;
    &lt;/attachment&gt;
  &lt;/mail&gt;
  &lt;mail id=&quot;1&quot;&gt;
    &lt;envelope From=&quot;zack@cs.unibo.it&quot;&gt;
      &lt;From&gt;zack@di.ens.fr&lt;/From&gt;
      &lt;To&gt;bill@microsoft.com&lt;/To&gt;
      &lt;Date&gt;2003-10-15T16:17:39Z&lt;/Date&gt;
      &lt;Subject&gt;Re: I desperately need XML Schema support in CDuce&lt;/Subject&gt;
    &lt;/envelope&gt;
    &lt;body&gt;
      user@unknown.domain.org wrote:
      &gt; As subject says, is possible to implement it?

      Sure, I'm working on it, in a few years^Wdays it will be finished
    &lt;/body&gt;
  &lt;/mail&gt;
&lt;/mails&gt;
</pre></div></div><div class="meta"><p><a href="sitemap.html">Site map</a></p></div><div class="smallbox"><p><a href="index.html">CDuce: documentation</a>: <a href="manual.html">User's manual</a>: XML Schema sample documents</p><p><a href="manual_schema.html"><img class="icon" width="16" alt="Previous page:" height="16" src="img/left.gif"/> XML Schema</a> <a href="manual_interfacewithocaml.html"><img class="icon" width="16" alt="Next page:" height="16" src="img/right.gif"/> Interfacing CDuce with OCaml</a></p></div></div></td></tr></table></body></html>