Work In Progress Echo Schemas
I am working on a RelaxNG schema, from which an XML Schema is derived; when I post that, discussion can take place in [RelaxSchema].
<?xml version="1.0" encoding="UTF-8"?> <xs:schema targetNamespace="http://purl.org/echo" xmlns:echo="http://purl.org/echo" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="feed"> <xs:complexType> <xs:sequence> <xs:element ref="echo:name"/> <xs:element ref="echo:link"/> <xs:element ref="echo:description" minOccurs="0"/> <xs:element ref="echo:entry" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="name" type="xs:string"/> <xs:element name="permalink" type="xs:anyURI"/> <xs:element name="link" type="xs:anyURI"/> <xs:element name="description" type="xs:string"/> <xs:element name="author"> <xs:complexType> <xs:sequence> <xs:element ref="echo:name"/> <xs:element ref="echo:link" minOccurs="0"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="entry"> <xs:complexType> <xs:sequence> <xs:element ref="echo:author"/> <xs:element ref="echo:permalink"/> <xs:element ref="echo:post-date"/> <xs:element ref="echo:created-date"/> <xs:element ref="echo:last-modified-date"/> <xs:element name="title" type="xs:string"/> <xs:element ref="echo:content" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="id" type="xs:ID" use="required"/> </xs:complexType> </xs:element> <xs:element name="post-date" type="xs:dateTime"/> <xs:element name="created-date" type="xs:dateTime"/> <xs:element name="last-modified-date" type="xs:dateTime"/> <xs:element name="content"> <xs:complexType mixed="true"> <xs:sequence minOccurs="0" maxOccurs="unbounded"> <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="type" type="xs:string" use="required"/> <xs:attribute name="href" type="xs:anyURI" use="optional"/> </xs:complexType> </xs:element> </xs:schema>
Element | Type | Description | ||
name | string | basic string. mixed-in HTML not allowed | ||
permalink | URL | Specifies the permanent location of the entry. Relative to xml:base optionally specified on feed element | ||
link | URL | URL references an external resource. Relative to xml:base optionally specified on feed element | ||
description | string | basic string. mixed-in HTML not allowed | ||
author | only one author per entry. will deal with contributors later | |||
post-date | DateTime | RFC3339/ISO8601/RFC1123 | ||
created-date | DateTime | RFC3339/ISO8601/RFC1123 | ||
last-modified-date | DateTime | RFC3339/ISO8601/RFC1123 | ||
title | string | basic string. mixed-in HTML not allowed | ||
content | one or more per entry |
[DiegoDoval, RefactorOk] Suggestion: Use a single date format. There are small differences between the proposed date formats. (RFC3339 is based on ISO8601, but it's not exactly the same) Is there any reason why three standard documents must be quoted? I think we should settle on a single RFC or ISO standard. The EchoExample specifies that "All dates are W3CDTF".
[AsbjornUlsberg, RefactorOk] +1 on W3CDTF. I see absolutely no point in allowing any other date-format, as W3CDTF covers "it all". We don't need another format, and I certainly don't want another format.
-
+1 [JeremyGray] W3C XML Schema dateTime format == the goods. Concise, consistent, well supported by good tools (I neither make or accept excuses for bad tools ). I'd even be willing to soften my Zulu-only view as presented elsewhere on this Wiki regarding timestamps, if it would help drive consensus on W3CDTF for timestamping across the standard.
[DeveloperDude, RefactorOk] This is my relaxed XML schema for Atom. I also created a strict one too. Why relaxed and strict? Because Atom cannot be accurately expressed in XML schema. Relaxed meaning that it'll accept any valid Atom and some invalid Atom. Strict meaning that it'll accept no invalid Atom and reject some valid Atom. I had a little difficulty trying to figure out what is the latest between the conflicting EchoExample and specs. More on my blog and my blog.
[JamesAylett] If we can't capture all Atom validity issues in a schema, then surely either we shouldn't use that schema language, or we should change what we mean by Atom validity so it's actually expressable. As far as I can tell, the differences in your schemas are in recurrence and ordering, which can just be agreed on in the spec and we're done. Is there anything beyond there that needs attention? (Spec land has been modified more recently than EchoExample, but that's not a clear indication that it's the right way to go ...)
-
[DeveloperDude] If we can agree on order of elements, then Atom becomes completely expressible in XML Schema. And thanks for the points on Spec v EchoExample. I was also hoping for feedback on the scripts, i.e. how to improve it. I'll post it in forum.
See ComponentBlog