RelaxNG/publiset.rnc
changeset 66 29c53c3d676e
parent 52 cb9addc3d98a
child 96 4817d2fa8801
equal deleted inserted replaced
65:2aad27159a33 66:29c53c3d676e
    31    composition.id.attribute
    31    composition.id.attribute
    32  & path.attribute?
    32  & path.attribute?
    33  & xpath.attribute?
    33  & xpath.attribute?
    34  & xslt.attribute?
    34  & xslt.attribute?
    35  & remap.attributes
    35  & remap.attributes
       
    36  & lang.attribute?
    36 composition.id.attribute = attribute xml:id { xsd:ID }
    37 composition.id.attribute = attribute xml:id { xsd:ID }
    37 path.attribute = attribute path { xsd:anyURI }
    38 path.attribute = attribute path { xsd:anyURI }
    38 xslt.attribute = attribute xslt { xsd:anyURI }
    39 xslt.attribute = attribute xslt { xsd:anyURI }
    39 xpath.attribute = attribute xpath { text }
    40 xpath.attribute = attribute xpath { text }
       
    41 lang.attribute = attribute xml:lang { xsd:language }
    40 
    42 
    41 composition.content =
    43 composition.content =
    42    composition.head?,
    44    composition.head?,
    43    (composition.division | composition.file)+
    45    (composition.division | composition.file)+
    44 
    46 
    50 }
    52 }
    51 
    53 
    52 selection.attributes =
    54 selection.attributes =
    53    selection.id.attribute
    55    selection.id.attribute
    54  & path.attribute?
    56  & path.attribute?
       
    57  & lang.attribute?
    55 selection.id.attribute = attribute xml:id { xsd:ID }
    58 selection.id.attribute = attribute xml:id { xsd:ID }
    56 
    59 
    57 selection.content =
    60 selection.content =
    58    selection.head?,
    61    selection.head?,
    59    (selection.division | selection.file | link)+
    62    (selection.division | selection.file | link)+
    73    remap.attributes
    76    remap.attributes
    74 
    77 
    75 top.head.content =
    78 top.head.content =
    76    (title, subtitle?)?
    79    (title, subtitle?)?
    77  & identifier*
    80  & identifier*
    78  & language?
       
    79  & copyright?
    81  & copyright?
    80  & author*
    82  & contributors?
    81  & publisher?
       
    82  & abstract?
    83  & abstract?
    83  & cover?
    84  & cover?
    84 division.head.content =
    85 division.head.content =
    85    (title, subtitle?)?
    86    (title, subtitle?)?
    86  & language?
       
    87 
    87 
    88 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    88 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    89 
    89 
    90 title = element title { title.content }
    90 title = element title { title.content }
    91 subtitle = element subtitle { title.content }
    91 subtitle = element subtitle { title.content }
   102    attribute type { "ean" }, xsd:token {pattern = "\d{13}"}
   102    attribute type { "ean" }, xsd:token {pattern = "\d{13}"}
   103 }
   103 }
   104 
   104 
   105 identifier = identifier.uri | identifier.ean
   105 identifier = identifier.uri | identifier.ean
   106 
   106 
   107 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   108 
       
   109 language = element language { language.attributes }
       
   110 
       
   111 language.attributes = lang.attribute
       
   112 lang.attribute = attribute xml:lang { xsd:language }
       
   113 
       
   114 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   107 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   115 
   108 
   116 copyright = element copyright { copyright.content }
   109 copyright = element copyright { copyright.content }
   117 
   110 
   118 copyright.content = inlines
   111 copyright.content = inlines
   119 
   112 
   120 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ author, publisher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   113 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   121 
   114 
   122 # ~~~~~~ author
   115 # ~~~~~~ contributors
   123 author = element author { author.content }
   116 contributors = element contributors { contributors.content }
   124 
   117 
   125 author.attributes =
   118 contributors.content =
   126    role.attribute?
   119    contributor+
   127 role.attribute = attribute role { "author" | "illustrator" }
   120 
   128 
   121 # ~~~~~~ contributor
   129 author.content =
   122 contributor = element contributor { contributor.content }
   130    firstname?,
   123 
   131    lastname,
   124 contributor.content =
       
   125    (((firstname, secondname?)?, lastname) | label),
       
   126    address?,
       
   127    link?,
   132    role*
   128    role*
   133 
   129 
   134 # ~~~~~~ publisher
   130 # ~~~~~~ firstname, secondname, lastname, label
   135 publisher = element publisher { publisher.content }
       
   136 
       
   137 publisher.content =
       
   138    label,
       
   139    link?
       
   140 
       
   141 # ~~~~~~ firstname
       
   142 firstname = element firstname { firstname.content }
   131 firstname = element firstname { firstname.content }
       
   132 secondname = element secondname { secondname.content }
       
   133 lastname = element lastname { lastname.content }
       
   134 label = element label { label.content }
   143 
   135 
   144 firstname.content = inlines
   136 firstname.content = inlines
   145 
   137 secondname.content = inlines
   146 # ~~~~~~ lastname
       
   147 lastname = element lastname { lastname.content }
       
   148 
       
   149 lastname.content = inlines
   138 lastname.content = inlines
       
   139 label.content = inlines
       
   140 
       
   141 # ~~~~~~ address
       
   142 address = element address { address.content }
       
   143 
       
   144 address.content = inlines
   150 
   145 
   151 # ~~~~~~ role
   146 # ~~~~~~ role
   152 role = element role { role.attributes }
   147 role = element role { role.content }
   153 
   148 
   154 role.attributes =
   149 role.content = "author" | "illustrator" | "publisher"
   155    role.of.attribute
       
   156 role.of.attribute = attribute of { "author" | "illustrator" }
       
   157 
       
   158 # ~~~~~~ label
       
   159 label = element label { label.content }
       
   160 
       
   161 label.content = inlines
       
   162 
   150 
   163 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   151 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   164 
   152 
   165 abstract = element abstract { abstract.content }
   153 abstract = element abstract { abstract.content }
   166 
   154