Subject: Content datatypes in XSD?

From: Danny Ayers <[email-masked]>
Date: Mon, 17 Jan 2005 20:54:48 +0100

It's been a long time since I looked at XML schemas, but would be
possible to express the content type attribute at all neatly using a
complex type? I imagine the "TEXT" | "HTML" | "XHTML" part would be
straightforward, but doesn't the | "pretty/much;anything" option screw
things up?

Cheers,
Danny.

5.12.1  "type" attribute

   atom:content MAY have a "type" attribute, When present, the value MAY
   be one of "TEXT", "HTML", or "XHTML".  Failing that, it MUST be a
   MIME media type [RFC2045] in which, to use the terminology of Section
   5 of [RFC2045], the top level is a discrete type.  If the type
   attribute is not provided, software MUST behave as though it were
   present with a value of "TEXT".

-- 

http://dannyayers.com

---

From: Martin Duerst <[email-masked]>
Date: Tue, 18 Jan 2005 14:39:33 +0900

>straightforward, but doesn't the | "pretty/much;anything" option screw

It's not 'pretty much anything', it's a Mime media type.
This can easily be defined with an XML Schema pattern.
The "TEXT" | "HTML" | "XHTML" can also be made part of
that pattern, or can be defined as an enumeration type
and unioned with the media type pattern.

Regards,    Martin.