<!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%" cellspacing="10" cellpadding="0"><tr><td valign="top" align="left" style="width:20%;"><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> <!-- mails.xsd --> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="mails" type="mailsType" /> <xsd:complexType name="mailsType"> <xsd:sequence minOccurs="0" maxOccurs="unbounded"> <xsd:element name="mail" type="mailType" /> </xsd:sequence> </xsd:complexType> <xsd:complexType name="mailType"> <xsd:sequence> <xsd:element name="envelope" type="envelopeType" /> <xsd:element name="body" type="bodyType" /> <xsd:element name="attachment" type="attachmentType" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> <xsd:attribute use="required" name="id" type="xsd:integer" /> </xsd:complexType> <xsd:element name="header"> <xsd:complexType> <xsd:simpleContent> <xsd:extension base="xsd:string"> <xsd:attribute ref="name" use="required" /> </xsd:extension> </xsd:simpleContent> </xsd:complexType> </xsd:element> <xsd:element name="Date" type="xsd:dateTime" /> <xsd:complexType name="envelopeType"> <xsd:sequence> <xsd:element name="From" type="xsd:string" /> <xsd:element name="To" type="xsd:string" /> <xsd:element ref="Date" /> <xsd:element name="Subject" type="xsd:string" /> <xsd:element ref="header" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> <xsd:attribute name="From" type="xsd:string" use="required" /> </xsd:complexType> <xsd:simpleType name="bodyType"> <xsd:restriction base="xsd:string" /> </xsd:simpleType> <xsd:complexType name="attachmentType"> <xsd:group ref="attachmentContent" /> <xsd:attribute ref="name" use="required" /> </xsd:complexType> <xsd:group name="attachmentContent"> <xsd:sequence> <xsd:element name="mimetype"> <xsd:complexType> <xsd:attributeGroup ref="mimeTypeAttributes" /> </xsd:complexType> </xsd:element> <xsd:element name="content" type="xsd:string" minOccurs="0" /> </xsd:sequence> </xsd:group> <xsd:attribute name="name" type="xsd:string" /> <xsd:attributeGroup name="mimeTypeAttributes"> <xsd:attribute name="type" type="mimeTopLevelType" use="required" /> <xsd:attribute name="subtype" type="xsd:string" use="required" /> </xsd:attributeGroup> <xsd:simpleType name="mimeTopLevelType"> <xsd:restriction base="xsd:string"> <xsd:enumeration value="text" /> <xsd:enumeration value="multipart" /> <xsd:enumeration value="application" /> <xsd:enumeration value="message" /> <xsd:enumeration value="image" /> <xsd:enumeration value="audio" /> <xsd:enumeration value="video" /> </xsd:restriction> </xsd:simpleType> </xsd:schema> </pre></div></div><div><h2><a name="mails_xml">mails.xml</a></h2><div class="code"><pre> <!-- mails.xml --> <mails> <mail id="0"> <envelope From="bill@microsoft.com"> <From>user@unknown.domain.org</From> <To>user@cduce.org</To> <Date>2003-10-15T15:44:01Z</Date> <Subject>I desperately need XML Schema support in CDuce</Subject> <header name="Reply-To">bill@microsoft.com</header> </envelope> <body> As subject says, is it possible to implement it? </body> <attachment name="signature.doc"> <mimetype type="application" subtype="msword"/> <content> ### removed by spamoracle ### </content> </attachment> </mail> <mail id="1"> <envelope From="zack@cs.unibo.it"> <From>zack@di.ens.fr</From> <To>bill@microsoft.com</To> <Date>2003-10-15T16:17:39Z</Date> <Subject>Re: I desperately need XML Schema support in CDuce</Subject> </envelope> <body> user@unknown.domain.org wrote: > As subject says, is possible to implement it? Sure, I'm working on it, in a few years^Wdays it will be finished </body> </mail> </mails> </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>