Re: PIDF - using xml schema

Graham Klyne <[email protected]>
Newsgroups gmane.ietf.impp
Message-ID <[email protected]>
I'm not familiar enough with XML schema to check this in detail, but I 
think it would be a good idea to include an XML schema as an appendix.  Any 
examples in the document should be validated against this schema.

#g
--

At 03:42 PM 4/18/02 -0700, Carr, Wayne wrote:
>I know there was discussion of using XML Schema back in December, but some
>of that was more about whether validation needed to be done.  If the format
>is XML it should be possible to also define it using XML Schema - and more
>precisely - especially for showing where the extensions can go and also
>types.
>
>Here's a very quickly written version I made - I'm new to reading the list
>mail and drafts.  I think something like this in an appendix would help
>people get a clearer idea of the format than just the DTD since it makes
>both the extensions and types clear.  I think it's easier to read a simple
>schema than a DTD too.
>
>----------- XML Schema follows -------------
>
><?xml version="1.0" encoding="UTF-8"?>
><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>elementFormDefault="qualified" attributeFormDefault="unqualified">
>
>         <xs:element name="presence" type="presence" />
>
>         <xs:complexType name="presence">
>                 <xs:sequence>
>                         <xs:element name="tuple" type="tuple"
>maxOccurs="unbounded" />
>                         <xs:element name="note" type="xs:string"
>minOccurs="0" />
>                         <xs:any namespace="##other" minOccurs="0"
>maxOccurs="unbounded" processContents="lax" />
>                 </xs:sequence>
>                 <xs:attribute name="entity" type="xs:anyURI" use="required"
>/>
>         </xs:complexType>
>
>         <xs:complexType name="tuple">
>                 <xs:sequence>
>                         <xs:element name= "status" type="status" />
>                         <xs:element name="contact" type="contact"
>minOccurs="0" />
>                         <xs:element name="note" type="xs:string"
>minOccurs="0" />
>                         <xs:element name="timestamp" type="xs:dateTime"
>minOccurs="0"  />
>                 </xs:sequence>
>                 <xs:attribute name="id" type="xs:ID" use="required" />
>         </xs:complexType>
>
>         <xs:complexType name="status">
>                 <xs:sequence>
>                         <xs:element name= "basic" type="basic" />
>                         <xs:any namespace="##other" minOccurs="0"
>maxOccurs="unbounded" processContents="lax" />
>                 </xs:sequence>
>         </xs:complexType>
>
>         <xs:simpleType name="basic">
>                 <xs:restriction base="xs:string">
>                         <xs:enumeration value="open"/>
>                         <xs:enumeration value="closed"/>
>                 </xs:restriction>
>         </xs:simpleType>
>
>         <xs:complexType name="contact">
>                 <xs:simpleContent>
>                         <xs:extension base="xs:anyURI">
>                                 <xs:attribute name="priority"
>type="xs:unsignedByte" />
>                         </xs:extension>
>                 </xs:simpleContent>
>         </xs:complexType>
>
>  <!-- Global Attributes -->
>  <xs:attribute name="mustUnderstand" type="xs:boolean" default="0" />
>
></xs:schema>
>
>
>
>
>
>   [reminder: [email protected] for non-technical discussions, please]

-------------------
Graham Klyne
<[email protected]>



  [reminder: [email protected] for non-technical discussions, please]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.