Das atom031.xsd war steinalt, jetzt RNC aus dem ATOM-RFC mit trang zu RNG konvertiert

git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@490 31f61c52-7bfb-0310-b897-fc00f8a278f0
This commit is contained in:
astro 2006-07-28 02:47:16 +00:00
parent 255bd064c5
commit ca84a80f5f
3 changed files with 600 additions and 200 deletions

View File

@ -82,7 +82,7 @@ build/news-rss.xml : NOVALID_IGNORE:=true
build/news-rss.xml : VFLAGS_OUT=--noout --schema xsd/rss20.xsd
build/news-atom.xml : STYLE=xsl/atom.xsl
build/news-atom.xml : NOVALID_IGNORE:=true
build/news-atom.xml : VFLAGS_OUT=--noout --schema xsd/atom031.xsd
build/news-atom.xml : VFLAGS_OUT=--noout --relaxng xsd/atom.rng
#.INTERMEDIATE: news.xml
news.xml: $(NEWSITEMS)

599
xsd/atom.rng Normal file
View File

@ -0,0 +1,599 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
-*- rnc -*-
RELAX NG Compact Syntax Grammar for the
Atom Format Specification
draft-ietf-atompub-format-10
-->
<grammar xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s="http://www.ascc.net/xml/schematron" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<choice>
<ref name="atomFeed"/>
<ref name="atomEntry"/>
</choice>
</start>
<!-- Common attributes -->
<define name="atomCommonAttributes">
<optional>
<attribute name="xml:base">
<ref name="atomUri"/>
</attribute>
</optional>
<optional>
<attribute name="xml:lang">
<ref name="atomLanguageTag"/>
</attribute>
</optional>
<zeroOrMore>
<ref name="undefinedAttribute"/>
</zeroOrMore>
</define>
<!-- Text Constructs -->
<define name="atomPlainTextConstruct">
<ref name="atomCommonAttributes"/>
<optional>
<attribute name="type">
<choice>
<value>text</value>
<value>html</value>
</choice>
</attribute>
</optional>
<text/>
</define>
<define name="atomXHTMLTextConstruct">
<ref name="atomCommonAttributes"/>
<attribute name="type">
<value>xhtml</value>
</attribute>
<ref name="xhtmlDiv"/>
</define>
<define name="atomTextConstruct">
<choice>
<ref name="atomPlainTextConstruct"/>
<ref name="atomXHTMLTextConstruct"/>
</choice>
</define>
<!-- Person Construct -->
<define name="atomPersonConstruct">
<ref name="atomCommonAttributes"/>
<interleave>
<element name="atom:name">
<text/>
</element>
<optional>
<element name="atom:uri">
<ref name="atomUri"/>
</element>
</optional>
<optional>
<element name="atom:email">
<ref name="atomEmailAddress"/>
</element>
</optional>
<zeroOrMore>
<ref name="extensionElement"/>
</zeroOrMore>
</interleave>
</define>
<!-- Date Construct -->
<define name="atomDateConstruct">
<ref name="atomCommonAttributes"/>
<data type="dateTime"/>
</define>
<!-- atom:feed -->
<define name="atomFeed">
<element name="atom:feed">
<s:rule context="atom:feed">
<s:assert test="atom:author or not(atom:entry[not(atom:author)])">An atom:feed must have an atom:author unless all of its atom:entry children have an atom:author.</s:assert>
</s:rule>
<ref name="atomCommonAttributes"/>
<interleave>
<zeroOrMore>
<ref name="atomAuthor"/>
</zeroOrMore>
<zeroOrMore>
<ref name="atomCategory"/>
</zeroOrMore>
<zeroOrMore>
<ref name="atomContributor"/>
</zeroOrMore>
<optional>
<ref name="atomGenerator"/>
</optional>
<optional>
<ref name="atomIcon"/>
</optional>
<ref name="atomId"/>
<zeroOrMore>
<ref name="atomLink"/>
</zeroOrMore>
<optional>
<ref name="atomLogo"/>
</optional>
<optional>
<ref name="atomRights"/>
</optional>
<optional>
<ref name="atomSubtitle"/>
</optional>
<ref name="atomTitle"/>
<ref name="atomUpdated"/>
<zeroOrMore>
<ref name="extensionElement"/>
</zeroOrMore>
</interleave>
<zeroOrMore>
<ref name="atomEntry"/>
</zeroOrMore>
</element>
</define>
<!-- atom:entry -->
<define name="atomEntry">
<element name="atom:entry">
<s:rule context="atom:entry">
<s:assert test="atom:link[@rel='alternate'] or atom:link[not(@rel)] or atom:content">An atom:entry must have at least one atom:link element with a rel attribute of 'alternate' or an atom:content.</s:assert>
</s:rule>
<s:rule context="atom:entry">
<s:assert test="atom:author or ../atom:author or atom:source/atom:author">An atom:entry must have an atom:author if its feed does not.</s:assert>
</s:rule>
<ref name="atomCommonAttributes"/>
<interleave>
<zeroOrMore>
<ref name="atomAuthor"/>
</zeroOrMore>
<zeroOrMore>
<ref name="atomCategory"/>
</zeroOrMore>
<optional>
<ref name="atomContent"/>
</optional>
<zeroOrMore>
<ref name="atomContributor"/>
</zeroOrMore>
<ref name="atomId"/>
<zeroOrMore>
<ref name="atomLink"/>
</zeroOrMore>
<optional>
<ref name="atomPublished"/>
</optional>
<optional>
<ref name="atomRights"/>
</optional>
<optional>
<ref name="atomSource"/>
</optional>
<optional>
<ref name="atomSummary"/>
</optional>
<ref name="atomTitle"/>
<ref name="atomUpdated"/>
<zeroOrMore>
<ref name="extensionElement"/>
</zeroOrMore>
</interleave>
</element>
</define>
<!-- atom:content -->
<define name="atomInlineTextContent">
<element name="atom:content">
<ref name="atomCommonAttributes"/>
<optional>
<attribute name="type">
<choice>
<value>text</value>
<value>html</value>
</choice>
</attribute>
</optional>
<zeroOrMore>
<text/>
</zeroOrMore>
</element>
</define>
<define name="atomInlineXHTMLContent">
<element name="atom:content">
<ref name="atomCommonAttributes"/>
<attribute name="type">
<value>xhtml</value>
</attribute>
<ref name="xhtmlDiv"/>
</element>
</define>
<define name="atomInlineOtherContent">
<element name="atom:content">
<ref name="atomCommonAttributes"/>
<optional>
<attribute name="type">
<ref name="atomMediaType"/>
</attribute>
</optional>
<zeroOrMore>
<choice>
<text/>
<ref name="anyElement"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="atomOutOfLineContent">
<element name="atom:content">
<ref name="atomCommonAttributes"/>
<optional>
<attribute name="type">
<ref name="atomMediaType"/>
</attribute>
</optional>
<attribute name="src">
<ref name="atomUri"/>
</attribute>
<empty/>
</element>
</define>
<define name="atomContent">
<choice>
<ref name="atomInlineTextContent"/>
<ref name="atomInlineXHTMLContent"/>
<ref name="atomInlineOtherContent"/>
<ref name="atomOutOfLineContent"/>
</choice>
</define>
<!-- atom:author -->
<define name="atomAuthor">
<element name="atom:author">
<ref name="atomPersonConstruct"/>
</element>
</define>
<!-- atom:category -->
<define name="atomCategory">
<element name="atom:category">
<ref name="atomCommonAttributes"/>
<attribute name="term"/>
<optional>
<attribute name="scheme">
<ref name="atomUri"/>
</attribute>
</optional>
<optional>
<attribute name="label"/>
</optional>
<ref name="undefinedContent"/>
</element>
</define>
<!-- atom:contributor -->
<define name="atomContributor">
<element name="atom:contributor">
<ref name="atomPersonConstruct"/>
</element>
</define>
<!-- atom:generator -->
<define name="atomGenerator">
<element name="atom:generator">
<ref name="atomCommonAttributes"/>
<optional>
<attribute name="uri">
<ref name="atomUri"/>
</attribute>
</optional>
<optional>
<attribute name="version"/>
</optional>
<text/>
</element>
</define>
<!-- atom:icon -->
<define name="atomIcon">
<element name="atom:icon">
<ref name="atomCommonAttributes"/>
<ref name="atomUri"/>
</element>
</define>
<!-- atom:id -->
<define name="atomId">
<element name="atom:id">
<ref name="atomCommonAttributes"/>
<ref name="atomUri"/>
</element>
</define>
<!-- atom:logo -->
<define name="atomLogo">
<element name="atom:logo">
<ref name="atomCommonAttributes"/>
<ref name="atomUri"/>
</element>
</define>
<!-- atom:link -->
<define name="atomLink">
<element name="atom:link">
<ref name="atomCommonAttributes"/>
<attribute name="href">
<ref name="atomUri"/>
</attribute>
<optional>
<attribute name="rel">
<choice>
<ref name="atomNCName"/>
<ref name="atomUri"/>
</choice>
</attribute>
</optional>
<optional>
<attribute name="type">
<ref name="atomMediaType"/>
</attribute>
</optional>
<optional>
<attribute name="hreflang">
<ref name="atomLanguageTag"/>
</attribute>
</optional>
<optional>
<attribute name="title"/>
</optional>
<optional>
<attribute name="length"/>
</optional>
<ref name="undefinedContent"/>
</element>
</define>
<!-- atom:published -->
<define name="atomPublished">
<element name="atom:published">
<ref name="atomDateConstruct"/>
</element>
</define>
<!-- atom:rights -->
<define name="atomRights">
<element name="atom:rights">
<ref name="atomTextConstruct"/>
</element>
</define>
<!-- atom:source -->
<define name="atomSource">
<element name="atom:source">
<ref name="atomCommonAttributes"/>
<interleave>
<optional>
<ref name="atomAuthor"/>
</optional>
<zeroOrMore>
<ref name="atomCategory"/>
</zeroOrMore>
<zeroOrMore>
<ref name="atomContributor"/>
</zeroOrMore>
<optional>
<ref name="atomGenerator"/>
</optional>
<optional>
<ref name="atomIcon"/>
</optional>
<optional>
<ref name="atomId"/>
</optional>
<zeroOrMore>
<ref name="atomLink"/>
</zeroOrMore>
<optional>
<ref name="atomLogo"/>
</optional>
<optional>
<ref name="atomRights"/>
</optional>
<optional>
<ref name="atomSubtitle"/>
</optional>
<optional>
<ref name="atomTitle"/>
</optional>
<optional>
<ref name="atomUpdated"/>
</optional>
<zeroOrMore>
<ref name="extensionElement"/>
</zeroOrMore>
</interleave>
</element>
</define>
<!-- atom:subtitle -->
<define name="atomSubtitle">
<element name="atom:subtitle">
<ref name="atomTextConstruct"/>
</element>
</define>
<!-- atom:summary -->
<define name="atomSummary">
<element name="atom:summary">
<ref name="atomTextConstruct"/>
</element>
</define>
<!-- atom:title -->
<define name="atomTitle">
<element name="atom:title">
<ref name="atomTextConstruct"/>
</element>
</define>
<!-- atom:updated -->
<define name="atomUpdated">
<element name="atom:updated">
<ref name="atomDateConstruct"/>
</element>
</define>
<!-- Low-level simple types -->
<define name="atomNCName">
<data type="string">
<param name="minLength">1</param>
<param name="pattern">[^:]*</param>
</data>
</define>
<!-- Whatever a media type is, it contains at least one slash -->
<define name="atomMediaType">
<data type="string">
<param name="pattern">.+/.+</param>
</data>
</define>
<!-- As defined in RFC 3066 -->
<define name="atomLanguageTag">
<data type="string">
<param name="pattern">[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*</param>
</data>
</define>
<!--
Unconstrained; it's not entirely clear how IRI fit into
xsd:anyURI so let's not try to constrain it here
-->
<define name="atomUri">
<text/>
</define>
<!-- Whatever an email address is, it contains at least one @ -->
<define name="atomEmailAddress">
<data type="string">
<param name="pattern">.+@.+</param>
</data>
</define>
<!-- Simple Extension -->
<define name="simpleExtensionElement">
<element>
<anyName>
<except>
<nsName ns="http://www.w3.org/2005/Atom"/>
</except>
</anyName>
<text/>
</element>
</define>
<!-- Structured Extension -->
<define name="structuredExtensionElement">
<element>
<anyName>
<except>
<nsName ns="http://www.w3.org/2005/Atom"/>
</except>
</anyName>
<choice>
<group>
<oneOrMore>
<attribute>
<anyName/>
</attribute>
</oneOrMore>
<zeroOrMore>
<choice>
<text/>
<ref name="anyElement"/>
</choice>
</zeroOrMore>
</group>
<group>
<zeroOrMore>
<attribute>
<anyName/>
</attribute>
</zeroOrMore>
<group>
<optional>
<text/>
</optional>
<oneOrMore>
<ref name="anyElement"/>
</oneOrMore>
<zeroOrMore>
<choice>
<text/>
<ref name="anyElement"/>
</choice>
</zeroOrMore>
</group>
</group>
</choice>
</element>
</define>
<!-- Other Extensibility -->
<define name="extensionElement">
<choice>
<ref name="simpleExtensionElement"/>
<ref name="structuredExtensionElement"/>
</choice>
</define>
<define name="undefinedAttribute">
<attribute>
<anyName>
<except>
<name>xml:base</name>
<name>xml:lang</name>
<nsName ns=""/>
</except>
</anyName>
</attribute>
</define>
<define name="undefinedContent">
<zeroOrMore>
<choice>
<text/>
<ref name="anyForeignElement"/>
</choice>
</zeroOrMore>
</define>
<define name="anyElement">
<element>
<anyName/>
<zeroOrMore>
<choice>
<attribute>
<anyName/>
</attribute>
<text/>
<ref name="anyElement"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="anyForeignElement">
<element>
<anyName>
<except>
<nsName ns="http://www.w3.org/2005/Atom"/>
</except>
</anyName>
<zeroOrMore>
<choice>
<attribute>
<anyName/>
</attribute>
<text/>
<ref name="anyElement"/>
</choice>
</zeroOrMore>
</element>
</define>
<!-- XHTML -->
<define name="anyXHTML">
<element>
<nsName ns="http://www.w3.org/1999/xhtml"/>
<zeroOrMore>
<choice>
<attribute>
<anyName/>
</attribute>
<text/>
<ref name="anyXHTML"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="xhtmlDiv">
<element name="xhtml:div">
<zeroOrMore>
<choice>
<attribute>
<anyName/>
</attribute>
<text/>
<ref name="anyXHTML"/>
</choice>
</zeroOrMore>
</element>
</define>
</grammar>
<!-- EOF -->

View File

@ -1,199 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://purl.org/atom/ns#" elementFormDefault="qualified" attributeFormDefault="unqualified"
xmlns:atom="http://purl.org/atom/ns#" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:documentation>
This version of the Atom API schema is based on version 0.3 of the Atom API and format specifications,
found here http://www.ietf.org/internet-drafts/draft-ietf-atompub-protocol-00.txt
and here http://www.ietf.org/internet-drafts/draft-ietf-atompub-format-00.txt.
</xs:documentation>
</xs:annotation>
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd" />
<xs:element name="feed" type="atom:feedType">
<xs:annotation>
<xs:documentation>
The Atom feed is defined in section 4 of the format spec.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="feedinfoType">
<xs:choice maxOccurs="unbounded">
<xs:element name="title" type="atom:contentType" />
<xs:element name="author" type="atom:authorType" />
<xs:element name="contributor" type="atom:authorType" />
<xs:element name="tagline" type="atom:contentType" />
<xs:element name="link" type="atom:linkType" />
<xs:element name="id" type="atom:uriType" />
<xs:element name="generator" type="atom:generatorType" />
<xs:element name="copyright" type="atom:contentType" />
<xs:element name="info" type="atom:contentType" />
<xs:element name="modified" type="atom:dateTimeType" />
</xs:choice>
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:complexType>
<xs:complexType name="feedType">
<xs:sequence>
<xs:element name="feedinfo" type="atom:feedinfoType" />
<xs:element name="entry" type="atom:entryType" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="version" type="atom:versionType" use="required" />
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:complexType>
<xs:element name="entry" type="atom:entryType">
<xs:annotation>
<xs:documentation>
The Atom feed is defined in section 4.13 of the format spec.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="entryType">
<xs:choice maxOccurs="unbounded">
<xs:element name="title" type="atom:contentType" />
<xs:element name="author" type="atom:authorType" />
<xs:element name="id" type="atom:stringType" />
<xs:element name="modified" type="atom:dateTimeType" />
<xs:element name="issued" type="atom:dateTimeType" />
<xs:element name="created" type="atom:dateTimeType" />
<xs:element name="summary" type="atom:contentType" />
<xs:element name="generator" type="atom:generatorType" />
<xs:element name="link" type="atom:linkType" />
<xs:element name="contributor" type="atom:authorType" />
<xs:element name="content" type="atom:contentType" />
</xs:choice>
<xs:attribute name="version" type="atom:versionType" use="required" />
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:complexType>
<xs:complexType name="contentType" mixed="true">
<xs:annotation>
<xs:documentation>
The Atom content construct is defined in section 3.1 of the format spec.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="type" use="optional" default="text/plain" />
<xs:attribute name="mode" use="optional" default="xml">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="xml" />
<xs:enumeration value="escaped" />
<xs:enumeration value="base64" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:complexType>
<xs:complexType name="authorType">
<xs:annotation>
<xs:documentation>
The Atom person construct is defined in section 3.2 of the format spec.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="name" type="atom:stringType" />
<xs:element name="url" type="atom:uriType" minOccurs="0" maxOccurs="1" />
<xs:element name="email" type="atom:emailType" minOccurs="0" maxOccurs="1" />
</xs:sequence>
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:complexType>
<xs:complexType name="linkType">
<xs:annotation>
<xs:documentation>
The Atom link construct is defined in section 3.4 of the format spec.
</xs:documentation>
</xs:annotation>
<xs:attribute name="rel" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="alternate" />
<xs:enumeration value="start" />
<xs:enumeration value="next" />
<xs:enumeration value="prev" />
<xs:enumeration value="service.edit" />
<xs:enumeration value="service.post" />
<xs:enumeration value="service.feed" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="type" use="required" type="xs:string" />
<xs:attribute name="href" use="required" type="xs:anyURI" />
<xs:attribute name="hreflang" use="optional" type="xs:NMTOKEN" />
<xs:attribute name="title" use="optional" type="xs:string" />
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:complexType>
<xs:complexType name="generatorType">
<xs:annotation>
<xs:documentation>
The Atom generator element is defined in section 4.9 of the format spec.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="url" use="optional" type="xs:anyURI" />
<xs:attribute name="version" use="optional" type="atom:versionType" />
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="uriType">
<xs:simpleContent>
<xs:extension base="xs:anyURI">
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="stringType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="dateTimeType">
<xs:simpleContent>
<xs:extension base="atom:iso8601dateTime">
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="iso8601dateTime">
<xs:annotation>
<xs:documentation>
The Atom date construct is defined in section 3.3 of the format spec.
</xs:documentation>
</xs:annotation>
<xs:union memberTypes="xs:dateTime xs:date xs:gYearMonth xs:gYear"/>
</xs:simpleType>
<xs:simpleType name="versionType">
<xs:annotation>
<xs:documentation>
General description for a version number.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:normalizedString">
<xs:pattern value="\d+\.\d+" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="emailType">
<xs:simpleContent>
<xs:extension base="atom:emailSimpleType">
<xs:attributeGroup ref="atom:commonAttributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="emailSimpleType">
<xs:annotation>
<xs:documentation>
Schema definition for an email address.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:normalizedString">
<xs:pattern value="\w+@(\w+\.)+\w+" />
</xs:restriction>
</xs:simpleType>
<xs:attributeGroup name="commonAttributes">
<xs:attribute ref="xml:base" />
<xs:attribute ref="xml:lang" />
</xs:attributeGroup>
</xs:schema>