<?xml version="1.0" encoding="utf-8"?>
-<element name="page"
- ns="http://cielonegro.org/schema/Rakka/Page/1.0"
+<grammar ns="http://cielonegro.org/schema/Rakka/Page/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
xmlns="http://relaxng.org/ns/structure/1.0">
- <attribute name="type">
- <text />
- </attribute>
+ <start>
+ <element name="page">
+ <optional>
+ <element name="updateInfo">
+ <!-- 旧リビジョン -->
+ <attribute name="oldRevision">
+ <data type="decimal">
+ <param name="minInclusive">0</param>
+ <param name="fractionDigits">0</param>
+ </data>
+ </attribute>
- <choice>
- <element name="textData">
- <text />
- </element>
+ <!-- ページ移動 -->
+ <optional>
+ <element name="move">
+ <attribute name="from">
+ <ref name="pageName" />
+ </attribute>
+ </element>
+ </optional>
+ </element>
+
+ <!-- 猶、更新時に type 屬性を空欄にすると自動判別される。但し
+ binaryData の場合のみ許される。 -->
+ </optional>
- <element name="binaryData">
- <text />
+ <optional>
+ <!-- ログインしてゐないユーザーの編集を禁止するフラグ -->
+ <attribute name="isLocked">
+ <ref name="boolean" />
+ </attribute>
+ </optional>
+
+ <choice>
+ <!-- リダイレクトの場合 -->
+ <ref name="redirection" />
+
+ <!-- リダイレクトでない場合 -->
+ <ref name="entity" />
+ </choice>
</element>
- </choice>
-</element>
+ </start>
+
+ <define name="boolean">
+ <choice>
+ <value>yes</value>
+ <value>no</value>
+ </choice>
+ </define>
+
+ <define name="pageName">
+ <data type="string">
+ <param name="pattern">[^ a-z.|#\[\]][^ .|#\[\]]*</param>
+ </data>
+ </define>
+
+ <define name="redirection">
+ <attribute name="redirect">
+ <ref name="pageName" />
+ </attribute>
+ </define>
+
+ <define name="entity">
+ <group>
+ <attribute name="type">
+ <!-- MIME Type -->
+ <text />
+ </attribute>
+
+ <optional>
+ <attribute name="lang">
+ <data type="language" />
+ </attribute>
+ </optional>
+
+ <optional>
+ <!-- text/css でなければ無視される -->
+ <attribute name="isTheme">
+ <ref name="boolean" />
+ </attribute>
+ </optional>
+
+ <optional>
+ <!-- text/x-rakka でなければ無視される -->
+ <attribute name="isFeed">
+ <ref name="boolean" />
+ </attribute>
+ </optional>
+
+ <interleave>
+ <optional>
+ <element name="summary">
+ <text />
+ </element>
+ </optional>
+
+ <optional>
+ <element name="otherLang">
+ <zeroOrMore>
+ <element name="link">
+ <attribute name="lang">
+ <data type="language" />
+ </attribute>
+ <attribute name="page">
+ <ref name="pageName" />
+ </attribute>
+ </element>
+ </zeroOrMore>
+ </element>
+ </optional>
+ </interleave>
+
+ <choice>
+ <element name="textData">
+ <text />
+ </element>
+
+ <element name="binaryData">
+ <data type="base64Binary" />
+ </element>
+ </choice>
+ </group>
+ </define>
+</grammar>