RelaxNG/publidoc.rng
changeset 2 417bb62f2a77
parent 0 41a5385c69a2
child 3 59e42ac69f8f
equal deleted inserted replaced
1:5f332cc7150a 2:417bb62f2a77
     8     <element name="publidoc">
     8     <element name="publidoc">
     9       <ref name="publidoc.attributes"/>
     9       <ref name="publidoc.attributes"/>
    10       <ref name="publidoc.content"/>
    10       <ref name="publidoc.content"/>
    11     </element>
    11     </element>
    12   </define>
    12   </define>
    13   <!-- ~~~~~~ attributes -->
       
    14   <define name="publidoc.attributes">
    13   <define name="publidoc.attributes">
    15     <ref name="version.attribute"/>
    14     <ref name="version.attribute"/>
    16   </define>
    15   </define>
    17   <define name="version.attribute">
    16   <define name="version.attribute">
    18     <attribute name="version">
    17     <attribute name="version">
    19       <value>1.0</value>
    18       <value>1.0</value>
    20     </attribute>
    19     </attribute>
    21   </define>
    20   </define>
    22   <!-- ~~~~~~ content -->
       
    23   <define name="publidoc.content">
    21   <define name="publidoc.content">
    24     <choice>
    22     <choice>
    25       <ref name="document"/>
    23       <ref name="document"/>
    26       <ref name="top.topic"/>
    24       <ref name="top.topic"/>
    27     </choice>
    25     </choice>
    36     <element name="document">
    34     <element name="document">
    37       <ref name="document.attributes"/>
    35       <ref name="document.attributes"/>
    38       <ref name="document.content"/>
    36       <ref name="document.content"/>
    39     </element>
    37     </element>
    40   </define>
    38   </define>
    41   <!-- ~~~~~~ attributes -->
       
    42   <define name="document.attributes">
    39   <define name="document.attributes">
    43     <ref name="document.id.attribute"/>
    40     <ref name="document.id.attribute"/>
    44   </define>
    41   </define>
    45   <define name="document.id.attribute">
    42   <define name="document.id.attribute">
    46     <attribute name="xml:id">
    43     <attribute name="xml:id">
    47       <data type="ID"/>
    44       <data type="ID"/>
    48     </attribute>
    45     </attribute>
    49   </define>
    46   </define>
    50   <!-- ~~~~~~ content -->
       
    51   <define name="document.content">
    47   <define name="document.content">
    52     <optional>
    48     <optional>
    53       <ref name="metadata"/>
    49       <ref name="metadata"/>
    54     </optional>
    50     </optional>
    55     <choice>
    51     <choice>
   112       <zeroOrMore>
   108       <zeroOrMore>
   113         <ref name="annotation"/>
   109         <ref name="annotation"/>
   114       </zeroOrMore>
   110       </zeroOrMore>
   115     </interleave>
   111     </interleave>
   116   </define>
   112   </define>
   117   <define name="language">
       
   118     <element name="language">
       
   119       <ref name="language.attributes"/>
       
   120     </element>
       
   121   </define>
       
   122   <define name="language.attributes">
       
   123     <ref name="lang.attribute"/>
       
   124   </define>
       
   125   <define name="lang.attribute">
       
   126     <attribute name="xml:lang">
       
   127       <data type="language"/>
       
   128     </attribute>
       
   129   </define>
       
   130   <define name="place">
       
   131     <element name="place">
       
   132       <ref name="place.content"/>
       
   133     </element>
       
   134   </define>
       
   135   <define name="place.content">
       
   136     <ref name="inlines"/>
       
   137   </define>
       
   138   <define name="abstract">
       
   139     <element name="abstract">
       
   140       <ref name="abstract.content"/>
       
   141     </element>
       
   142   </define>
       
   143   <define name="abstract.content">
       
   144     <oneOrMore>
       
   145       <ref name="parag"/>
       
   146     </oneOrMore>
       
   147   </define>
       
   148   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   113   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   149   <define name="title">
   114   <define name="title">
   150     <element name="title">
   115     <element name="title">
   151       <ref name="title.content"/>
   116       <ref name="title.content"/>
   152     </element>
   117     </element>
   177     </element>
   142     </element>
   178   </define>
   143   </define>
   179   <define name="publisher.content">
   144   <define name="publisher.content">
   180     <ref name="inlines"/>
   145     <ref name="inlines"/>
   181   </define>
   146   </define>
       
   147   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
       
   148   <define name="language">
       
   149     <element name="language">
       
   150       <ref name="language.attributes"/>
       
   151     </element>
       
   152   </define>
       
   153   <define name="language.attributes">
       
   154     <ref name="lang.attribute"/>
       
   155   </define>
       
   156   <define name="lang.attribute">
       
   157     <attribute name="xml:lang">
       
   158       <data type="language"/>
       
   159     </attribute>
       
   160   </define>
       
   161   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
       
   162   <define name="place">
       
   163     <element name="place">
       
   164       <ref name="place.content"/>
       
   165     </element>
       
   166   </define>
       
   167   <define name="place.content">
       
   168     <ref name="inlines"/>
       
   169   </define>
   182   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   170   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
       
   171   <!-- ~~~~~~ source -->
   183   <define name="source">
   172   <define name="source">
   184     <element name="source">
   173     <element name="source">
   185       <ref name="source.attributes"/>
   174       <ref name="source.attributes"/>
   186       <choice>
   175       <choice>
   187         <group>
   176         <group>
   195         </attribute>
   184         </attribute>
   196       </choice>
   185       </choice>
   197       <ref name="source.content"/>
   186       <ref name="source.content"/>
   198     </element>
   187     </element>
   199   </define>
   188   </define>
   200   <!-- ~~~~~~ Attributes -->
       
   201   <define name="source.attributes">
   189   <define name="source.attributes">
   202     <ref name="source.id.attribute"/>
   190     <ref name="source.id.attribute"/>
   203   </define>
   191   </define>
   204   <define name="source.id.attribute">
   192   <define name="source.id.attribute">
   205     <attribute name="id">
   193     <attribute name="id">
   206       <data type="NMTOKEN"/>
   194       <data type="NMTOKEN"/>
   207     </attribute>
   195     </attribute>
   208   </define>
   196   </define>
   209   <!-- ~~~~~~ Content -->
       
   210   <define name="source.content.book">
   197   <define name="source.content.book">
   211     <ref name="title"/>
   198     <ref name="title"/>
   212     <zeroOrMore>
   199     <zeroOrMore>
   213       <ref name="pagenumber"/>
   200       <ref name="pagenumber"/>
   214     </zeroOrMore>
   201     </zeroOrMore>
   216   <define name="source.content">
   203   <define name="source.content">
   217     <zeroOrMore>
   204     <zeroOrMore>
   218       <ref name="annotation"/>
   205       <ref name="annotation"/>
   219     </zeroOrMore>
   206     </zeroOrMore>
   220   </define>
   207   </define>
       
   208   <!-- ~~~~~~ pagenumber -->
   221   <define name="pagenumber">
   209   <define name="pagenumber">
   222     <element name="pagenumber">
   210     <element name="pagenumber">
   223       <ref name="pagenumber.attributes"/>
   211       <ref name="pagenumber.attributes"/>
   224     </element>
   212     </element>
   225   </define>
   213   </define>
   233   </define>
   221   </define>
   234   <define name="pagenumber.value.enumeration">
   222   <define name="pagenumber.value.enumeration">
   235     <data type="positiveInteger"/>
   223     <data type="positiveInteger"/>
   236   </define>
   224   </define>
   237   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   225   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
       
   226   <!-- ~~~~~~ subjectset -->
   238   <define name="subjectset">
   227   <define name="subjectset">
   239     <element name="subjectset">
   228     <element name="subjectset">
   240       <ref name="subjectset.content"/>
   229       <ref name="subjectset.content"/>
   241     </element>
   230     </element>
   242   </define>
   231   </define>
   243   <define name="subjectset.content">
   232   <define name="subjectset.content">
   244     <oneOrMore>
   233     <oneOrMore>
   245       <ref name="subject"/>
   234       <ref name="subject"/>
   246     </oneOrMore>
   235     </oneOrMore>
   247   </define>
   236   </define>
       
   237   <!-- ~~~~~~ subject -->
   248   <define name="subject">
   238   <define name="subject">
   249     <element name="subject">
   239     <element name="subject">
   250       <ref name="subject.attributes"/>
   240       <ref name="subject.attributes"/>
   251     </element>
   241     </element>
   252   </define>
   242   </define>
   255   </define>
   245   </define>
   256   <define name="subject.id.attribute">
   246   <define name="subject.id.attribute">
   257     <attribute name="id">
   247     <attribute name="id">
   258       <data type="NMTOKEN"/>
   248       <data type="NMTOKEN"/>
   259     </attribute>
   249     </attribute>
       
   250   </define>
       
   251   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
       
   252   <define name="abstract">
       
   253     <element name="abstract">
       
   254       <ref name="abstract.content"/>
       
   255     </element>
       
   256   </define>
       
   257   <define name="abstract.content">
       
   258     <oneOrMore>
       
   259       <ref name="parag"/>
       
   260     </oneOrMore>
   260   </define>
   261   </define>
   261   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   262   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   262   <define name="annotation">
   263   <define name="annotation">
   263     <element name="annotation">
   264     <element name="annotation">
   264       <ref name="annotation.content"/>
   265       <ref name="annotation.content"/>
   301     <element name="topic">
   302     <element name="topic">
   302       <ref name="topic.attributes"/>
   303       <ref name="topic.attributes"/>
   303       <ref name="topic.content"/>
   304       <ref name="topic.content"/>
   304     </element>
   305     </element>
   305   </define>
   306   </define>
   306   <!-- ~~~~~~ attributes -->
       
   307   <define name="top.topic.attributes">
   307   <define name="top.topic.attributes">
   308     <interleave>
   308     <interleave>
   309       <ref name="topic.id.attribute"/>
   309       <ref name="topic.id.attribute"/>
   310       <optional>
   310       <optional>
   311         <ref name="topic.type.attribute"/>
   311         <ref name="topic.type.attribute"/>
   330   <define name="topic.type.attribute">
   330   <define name="topic.type.attribute">
   331     <attribute name="type">
   331     <attribute name="type">
   332       <data type="NCName"/>
   332       <data type="NCName"/>
   333     </attribute>
   333     </attribute>
   334   </define>
   334   </define>
   335   <!-- ~~~~~~ content -->
       
   336   <define name="topic.content">
   335   <define name="topic.content">
   337     <optional>
   336     <optional>
   338       <ref name="metadata"/>
   337       <ref name="metadata"/>
   339     </optional>
   338     </optional>
   340     <oneOrMore>
   339     <oneOrMore>
   397         <ref name="link"/>
   396         <ref name="link"/>
   398       </zeroOrMore>
   397       </zeroOrMore>
   399     </interleave>
   398     </interleave>
   400   </define>
   399   </define>
   401   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   400   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
       
   401   <!-- ~~~~~~ media -->
   402   <define name="media">
   402   <define name="media">
   403     <element name="media">
   403     <element name="media">
   404       <ref name="media.content"/>
   404       <ref name="media.content"/>
   405     </element>
   405     </element>
   406   </define>
   406   </define>
   415   <define name="media.id.attribute">
   415   <define name="media.id.attribute">
   416     <attribute name="id">
   416     <attribute name="id">
   417       <data type="NMTOKEN"/>
   417       <data type="NMTOKEN"/>
   418     </attribute>
   418     </attribute>
   419   </define>
   419   </define>
       
   420   <!-- ~~~~~~ caption -->
   420   <define name="media.caption">
   421   <define name="media.caption">
   421     <element name="caption">
   422     <element name="caption">
   422       <ref name="media.caption.content"/>
   423       <ref name="media.caption.content"/>
   423     </element>
   424     </element>
   424   </define>
   425   </define>
   425   <define name="media.caption.content">
   426   <define name="media.caption.content">
   426     <oneOrMore>
   427     <oneOrMore>
   427       <ref name="parag"/>
   428       <ref name="parag"/>
   428     </oneOrMore>
   429     </oneOrMore>
   429   </define>
   430   </define>
   430   <!-- ~~~~~~ Image -->
   431   <!-- ~~~~~~ image -->
   431   <define name="image">
   432   <define name="image">
   432     <element name="image">
   433     <element name="image">
   433       <ref name="image.attributes"/>
   434       <ref name="image.attributes"/>
   434       <ref name="image.content"/>
   435       <ref name="image.content"/>
   435     </element>
   436     </element>
   440   <define name="image.content">
   441   <define name="image.content">
   441     <optional>
   442     <optional>
   442       <ref name="copyright"/>
   443       <ref name="copyright"/>
   443     </optional>
   444     </optional>
   444   </define>
   445   </define>
       
   446   <!-- ~~~~~~ copyright -->
   445   <define name="copyright">
   447   <define name="copyright">
   446     <element name="copyright">
   448     <element name="copyright">
   447       <ref name="copyright.content"/>
   449       <ref name="copyright.content"/>
   448     </element>
   450     </element>
   449   </define>
   451   </define>
   532       <data type="date"/>
   534       <data type="date"/>
   533       <data type="gYearMonth"/>
   535       <data type="gYearMonth"/>
   534       <data type="gYear"/>
   536       <data type="gYear"/>
   535     </choice>
   537     </choice>
   536   </define>
   538   </define>
   537   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   539   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   538   <define name="firstname">
   540   <define name="firstname">
   539     <element name="firstname">
   541     <element name="firstname">
   540       <ref name="inlines"/>
   542       <ref name="inlines"/>
   541     </element>
   543     </element>
   542   </define>
   544   </define>
   553   </define>
   555   </define>
   554   <define name="name.attributes">
   556   <define name="name.attributes">
   555     <optional>
   557     <optional>
   556       <ref name="name.of.attribute"/>
   558       <ref name="name.of.attribute"/>
   557     </optional>
   559     </optional>
   558   </define>
       
   559   <define name="name.content">
       
   560     <ref name="inlines"/>
       
   561   </define>
   560   </define>
   562   <define name="name.of.attribute">
   561   <define name="name.of.attribute">
   563     <attribute name="of">
   562     <attribute name="of">
   564       <ref name="name.of.enumeration"/>
   563       <ref name="name.of.enumeration"/>
   565     </attribute>
   564     </attribute>
   571       <value>book</value>
   570       <value>book</value>
   572       <value>newspaper</value>
   571       <value>newspaper</value>
   573       <value>party</value>
   572       <value>party</value>
   574     </choice>
   573     </choice>
   575   </define>
   574   </define>
       
   575   <define name="name.content">
       
   576     <ref name="inlines"/>
       
   577   </define>
   576   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footnote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   578   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footnote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   577   <define name="footnote">
   579   <define name="footnote">
   578     <element name="footnote">
   580     <element name="footnote">
   579       <ref name="footnote.attributes"/>
   581       <ref name="footnote.attributes"/>
   580       <ref name="footnote.content"/>
   582       <ref name="footnote.content"/>