RelaxNG/publiset.rng
changeset 2 417bb62f2a77
parent 0 41a5385c69a2
child 5 69310bc35b63
equal deleted inserted replaced
1:5f332cc7150a 2:417bb62f2a77
     8     <element name="publiset">
     8     <element name="publiset">
     9       <ref name="publiset.attributes"/>
     9       <ref name="publiset.attributes"/>
    10       <ref name="publiset.content"/>
    10       <ref name="publiset.content"/>
    11     </element>
    11     </element>
    12   </define>
    12   </define>
    13   <!-- ~~~~~~ attributes -->
       
    14   <define name="publiset.attributes">
    13   <define name="publiset.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="publiset.content">
    21   <define name="publiset.content">
    24     <oneOrMore>
    22     <oneOrMore>
    25       <choice>
    23       <choice>
    26         <ref name="composition"/>
    24         <ref name="composition"/>
    27         <ref name="selection"/>
    25         <ref name="selection"/>
    38     <element name="composition">
    36     <element name="composition">
    39       <ref name="composition.attributes"/>
    37       <ref name="composition.attributes"/>
    40       <ref name="composition.content"/>
    38       <ref name="composition.content"/>
    41     </element>
    39     </element>
    42   </define>
    40   </define>
    43   <!-- ~~~~~~ attributes -->
       
    44   <define name="composition.attributes">
    41   <define name="composition.attributes">
    45     <interleave>
    42     <interleave>
    46       <ref name="composition.id.attribute"/>
    43       <ref name="composition.id.attribute"/>
    47       <optional>
    44       <optional>
    48         <ref name="base.attribute"/>
    45         <ref name="base.attribute"/>
    58   <define name="base.attribute">
    55   <define name="base.attribute">
    59     <attribute name="xml:base">
    56     <attribute name="xml:base">
    60       <data type="anyURI"/>
    57       <data type="anyURI"/>
    61     </attribute>
    58     </attribute>
    62   </define>
    59   </define>
    63   <!-- ~~~~~~ content -->
       
    64   <define name="composition.content">
    60   <define name="composition.content">
    65     <optional>
    61     <optional>
    66       <ref name="composition.metadata"/>
    62       <ref name="composition.metadata"/>
    67     </optional>
    63     </optional>
    68     <oneOrMore>
    64     <oneOrMore>
    77     <element name="selection">
    73     <element name="selection">
    78       <ref name="selection.attributes"/>
    74       <ref name="selection.attributes"/>
    79       <ref name="selection.content"/>
    75       <ref name="selection.content"/>
    80     </element>
    76     </element>
    81   </define>
    77   </define>
    82   <!-- ~~~~~~ attributes -->
       
    83   <define name="selection.attributes">
    78   <define name="selection.attributes">
    84     <optional>
    79     <optional>
    85       <ref name="base.attribute"/>
    80       <ref name="base.attribute"/>
    86     </optional>
    81     </optional>
    87   </define>
    82   </define>
    88   <define name="selection.id.attribute">
    83   <define name="selection.id.attribute">
    89     <attribute name="xml:id">
    84     <attribute name="xml:id">
    90       <data type="ID"/>
    85       <data type="ID"/>
    91     </attribute>
    86     </attribute>
    92   </define>
    87   </define>
    93   <!-- ~~~~~~ content -->
       
    94   <define name="selection.content">
    88   <define name="selection.content">
    95     <optional>
    89     <optional>
    96       <ref name="selection.metadata"/>
    90       <ref name="selection.metadata"/>
    97     </optional>
    91     </optional>
    98     <oneOrMore>
    92     <oneOrMore>
   117   <define name="selection.metadata">
   111   <define name="selection.metadata">
   118     <element name="metadata">
   112     <element name="metadata">
   119       <ref name="metadata.content"/>
   113       <ref name="metadata.content"/>
   120     </element>
   114     </element>
   121   </define>
   115   </define>
   122   <!-- ~~~~~~ attributes -->
       
   123   <define name="metadata.attributes">
   116   <define name="metadata.attributes">
   124     <ref name="remap.attributes"/>
   117     <ref name="remap.attributes"/>
   125   </define>
   118   </define>
   126   <!-- ~~~~~~ content -->
       
   127   <define name="metadata.content">
   119   <define name="metadata.content">
   128     <optional>
   120     <optional>
   129       <ref name="title"/>
   121       <ref name="title"/>
   130     </optional>
   122     </optional>
   131     <optional>
   123     <optional>
   148     <element name="subtitle">
   140     <element name="subtitle">
   149       <ref name="title.content"/>
   141       <ref name="title.content"/>
   150     </element>
   142     </element>
   151   </define>
   143   </define>
   152   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   144   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
       
   145   <!-- ~~~~~~ source -->
   153   <define name="source">
   146   <define name="source">
   154     <element name="source">
   147     <element name="source">
   155       <ref name="source.attributes"/>
   148       <ref name="source.attributes"/>
   156       <choice>
   149       <choice>
   157         <group>
   150         <group>
   164           <value>file</value>
   157           <value>file</value>
   165         </attribute>
   158         </attribute>
   166       </choice>
   159       </choice>
   167     </element>
   160     </element>
   168   </define>
   161   </define>
   169   <!-- ~~~~~~ Attributes -->
       
   170   <define name="source.attributes">
   162   <define name="source.attributes">
   171     <interleave>
   163     <interleave>
   172       <optional>
   164       <optional>
   173         <ref name="source.id.attribute"/>
   165         <ref name="source.id.attribute"/>
   174       </optional>
   166       </optional>
   178   <define name="source.id.attribute">
   170   <define name="source.id.attribute">
   179     <attribute name="id">
   171     <attribute name="id">
   180       <data type="NMTOKEN"/>
   172       <data type="NMTOKEN"/>
   181     </attribute>
   173     </attribute>
   182   </define>
   174   </define>
   183   <!-- ~~~~~~ Content -->
       
   184   <define name="source.content.book">
   175   <define name="source.content.book">
   185     <optional>
   176     <optional>
   186       <ref name="title"/>
   177       <ref name="title"/>
   187     </optional>
   178     </optional>
   188     <optional>
   179     <optional>
   189       <ref name="pagenumber"/>
   180       <ref name="pagenumber"/>
   190     </optional>
   181     </optional>
   191   </define>
   182   </define>
       
   183   <!-- ~~~~~~ pagenumber -->
   192   <define name="pagenumber">
   184   <define name="pagenumber">
   193     <element name="pagenumber">
   185     <element name="pagenumber">
   194       <ref name="pagenumber.attributes"/>
   186       <ref name="pagenumber.attributes"/>
   195     </element>
   187     </element>
   196   </define>
   188   </define>
   220     <element name="division">
   212     <element name="division">
   221       <ref name="selection.division.attributes"/>
   213       <ref name="selection.division.attributes"/>
   222       <ref name="selection.division.content"/>
   214       <ref name="selection.division.content"/>
   223     </element>
   215     </element>
   224   </define>
   216   </define>
   225   <!-- ~~~~~~ attributes -->
       
   226   <define name="composition.division.attributes">
   217   <define name="composition.division.attributes">
   227     <interleave>
   218     <interleave>
   228       <optional>
   219       <optional>
   229         <ref name="base.attribute"/>
   220         <ref name="base.attribute"/>
   230       </optional>
   221       </optional>
   234   <define name="selection.division.attributes">
   225   <define name="selection.division.attributes">
   235     <optional>
   226     <optional>
   236       <ref name="base.attribute"/>
   227       <ref name="base.attribute"/>
   237     </optional>
   228     </optional>
   238   </define>
   229   </define>
   239   <!-- ~~~~~~ content -->
       
   240   <define name="composition.division.content">
   230   <define name="composition.division.content">
   241     <optional>
   231     <optional>
   242       <ref name="composition.metadata"/>
   232       <ref name="composition.metadata"/>
   243     </optional>
   233     </optional>
   244     <oneOrMore>
   234     <oneOrMore>
   266   -->
   256   -->
   267   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   257   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   268   <define name="composition.file">
   258   <define name="composition.file">
   269     <element name="file">
   259     <element name="file">
   270       <ref name="composition.file.attributes"/>
   260       <ref name="composition.file.attributes"/>
       
   261       <ref name="file.content"/>
   271     </element>
   262     </element>
   272   </define>
   263   </define>
   273   <define name="selection.file">
   264   <define name="selection.file">
   274     <element name="file">
   265     <element name="file">
   275       <ref name="selection.file.attributes"/>
   266       <ref name="selection.file.attributes"/>
   276     </element>
   267       <ref name="file.content"/>
   277   </define>
   268     </element>
   278   <!-- ~~~~~~ attributes -->
   269   </define>
   279   <define name="composition.file.attributes">
   270   <define name="composition.file.attributes">
   280     <interleave>
   271     <interleave>
   281       <ref name="name.attribute"/>
       
   282       <optional>
   272       <optional>
   283         <ref name="xpath.attribute"/>
   273         <ref name="xpath.attribute"/>
   284       </optional>
   274       </optional>
   285       <ref name="remap.attributes"/>
   275       <ref name="remap.attributes"/>
   286     </interleave>
   276     </interleave>
   287   </define>
   277   </define>
   288   <define name="selection.file.attributes">
   278   <define name="selection.file.attributes">
   289     <interleave>
   279     <optional>
   290       <ref name="name.attribute"/>
   280       <ref name="xpath.attribute"/>
   291       <optional>
   281     </optional>
   292         <ref name="xpath.attribute"/>
       
   293       </optional>
       
   294     </interleave>
       
   295   </define>
       
   296   <define name="name.attribute">
       
   297     <attribute name="name"/>
       
   298   </define>
   282   </define>
   299   <define name="xpath.attribute">
   283   <define name="xpath.attribute">
   300     <attribute name="xpath"/>
   284     <attribute name="xpath"/>
       
   285   </define>
       
   286   <define name="file.content">
       
   287     <data type="anyURI"/>
   301   </define>
   288   </define>
   302   <!--
   289   <!--
   303     =============================================================================
   290     =============================================================================
   304                                     Inline level
   291                                     Inline level
   305     =============================================================================
   292     =============================================================================