RelaxNG/publidoc.rnc
changeset 5 69310bc35b63
parent 3 59e42ac69f8f
child 8 1d4ee28efd68
equal deleted inserted replaced
4:1db220a61526 5:69310bc35b63
    67 
    67 
    68 subtitle = element subtitle { title.content }
    68 subtitle = element subtitle { title.content }
    69 
    69 
    70 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ author, publisher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    70 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ author, publisher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    71 
    71 
       
    72 # ~~~~~~ author
    72 author = element author { author.content }
    73 author = element author { author.content }
    73 
    74 
    74 author.content =
    75 author.content =
    75    firstname?,
    76    firstname?,
    76    lastname
    77    lastname
    77 
    78 
       
    79 # ~~~~~~ publisher
    78 publisher = element publisher { publisher.content }
    80 publisher = element publisher { publisher.content }
    79 
    81 
    80 publisher.content = inlines
    82 publisher.content = inlines
       
    83 
       
    84 # ~~~~~~ firstname
       
    85 firstname = element firstname { firstname.content }
       
    86 
       
    87 firstname.content = inlines
       
    88 
       
    89 # ~~~~~~ lastname
       
    90 lastname = element lastname { lastname.content }
       
    91 
       
    92 lastname.content = inlines
    81 
    93 
    82 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    94 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    83 
    95 
    84 language = element language { language.attributes }
    96 language = element language { language.attributes }
    85 
    97 
   132 
   144 
   133 subject.attributes =
   145 subject.attributes =
   134    subject.id.attribute
   146    subject.id.attribute
   135 subject.id.attribute = attribute id { xsd:NMTOKEN }
   147 subject.id.attribute = attribute id { xsd:NMTOKEN }
   136 
   148 
   137 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   149 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   138 
   150 
   139 abstract = element abstract { abstract.content }
   151 abstract = element abstract { abstract.content }
   140 
   152 
   141 abstract.content =
   153 abstract.content =
   142    parag+
   154    parag+
   192 section = element section { section.content, section.attributes }
   204 section = element section { section.content, section.attributes }
   193 
   205 
   194 section.content =
   206 section.content =
   195    metadata?,
   207    metadata?,
   196    (section+
   208    (section+
   197     | (parag | media)+)
   209     | (parag | media | speech)+)
   198 
   210 
   199 section.attributes =
   211 section.attributes =
   200    status.attribute?
   212    status.attribute?
   201 status.attribute = attribute status { xsd:NCName }
   213 status.attribute = attribute status { xsd:NCName }
   202 
   214 
   241 
   253 
   242 # ~~~~~~ copyright
   254 # ~~~~~~ copyright
   243 copyright = element copyright { copyright.content }
   255 copyright = element copyright { copyright.content }
   244 
   256 
   245 copyright.content = inlines
   257 copyright.content = inlines
       
   258 
       
   259 
       
   260 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   261 
       
   262 # ~~~~~~ speech
       
   263 speech = element speech { speech.content }
       
   264 
       
   265 speech.content =
       
   266    speaker?,
       
   267    stage?,
       
   268    parag+
       
   269 
       
   270 # ~~~~~~ speaker
       
   271 speaker = element speaker { speaker.content }
       
   272 
       
   273 speaker.content = inlines
       
   274 
       
   275 # ~~~~~~ stage
       
   276 stage = element stage { stage.content }
       
   277 
       
   278 stage.content = inlines
   246 
   279 
   247 
   280 
   248 # =============================================================================
   281 # =============================================================================
   249 #                                 Inline level
   282 #                                 Inline level
   250 # =============================================================================
   283 # =============================================================================
   255    sup*
   288    sup*
   256  & sub*
   289  & sub*
   257  & romannum*
   290  & romannum*
   258  & date*
   291  & date*
   259  & name*
   292  & name*
   260  & footnote*
   293  & note*
   261  & foreign*
   294  & foreign*
   262  & highlight*
   295  & highlight*
       
   296  & term*
       
   297  & mentioned*
       
   298  & quote*
   263 }
   299 }
   264 
   300 
   265 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   301 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   266 
   302 
   267 sup = element sup { inlines }
   303 sup = element sup { inlines }
   275 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   311 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   276 
   312 
   277 date = element date { date.attributes, date.content }
   313 date = element date { date.attributes, date.content }
   278 
   314 
   279 date.attributes =
   315 date.attributes =
   280    date.of.attribute
   316    date.of.attribute?
   281 date.of.attribute = attribute of { date.of.enumeration }
   317 date.of.attribute = attribute of { date.of.enumeration }
   282 date.of.enumeration = "event" | "birth" | "death"
   318 date.of.enumeration = "event" | "birth" | "death"
   283 
   319 
   284 date.content = xsd:date | xsd:gYearMonth | xsd:gYear
   320 date.content = xsd:date | xsd:gYearMonth | xsd:gYear
   285 
   321 
   286 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   322 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   287 
       
   288 firstname = element firstname { inlines }
       
   289 
       
   290 lastname = element lastname { inlines }
       
   291 
   323 
   292 name = element name { name.attributes, name.content }
   324 name = element name { name.attributes, name.content }
   293 
   325 
   294 name.attributes =
   326 name.attributes =
   295    name.of.attribute?
   327    name.of.attribute?
   296 name.of.attribute = attribute of { name.of.enumeration }
   328 name.of.attribute = attribute of { name.of.enumeration }
   297 name.of.enumeration = "person" | "company" | "book" | "newspaper" | "party"
   329 name.of.enumeration = "person" | "company" | "book" | "newspaper" | "party"
   298 
   330 
   299 name.content = inlines
   331 name.content = inlines
   300 
   332 
   301 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footnote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   333 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   302 
   334 
   303 footnote = element footnote { footnote.attributes, footnote.content }
   335 note = element note { note.attributes, note.content }
   304 
   336 
   305 footnote.attributes =
   337 note.attributes =
   306    footnote.label.attribute?
   338    note.label.attribute?
   307 footnote.label.attribute = attribute label { text }
   339 note.label.attribute = attribute label { text }
   308 
   340 
   309 footnote.content =
   341 note.content =
   310    parag+
   342    parag+
   311 
   343 
   312 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   344 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   313 
   345 
   314 foreign = element foreign { foreign.attributes, foreign.content }
   346 foreign = element foreign { foreign.attributes, foreign.content }
   321 
   353 
   322 highlight = element highlight { highlight.content }
   354 highlight = element highlight { highlight.content }
   323 
   355 
   324 highlight.content = inlines
   356 highlight.content = inlines
   325 
   357 
       
   358 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ term ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   359 
       
   360 term = element term { term.content }
       
   361 
       
   362 term.content = inlines
       
   363 
       
   364 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mentioned ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   365 
       
   366 mentioned = element mentioned { mentioned.content }
       
   367 
       
   368 mentioned.content = inlines
       
   369 
       
   370 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   371 
       
   372 quote = element quote { quote.content }
       
   373 
       
   374 quote.content = inlines
       
   375 
   326 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   376 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   327 
   377 
   328 link = element link { link.attributes, link.content }
   378 link = element link { link.attributes, link.content }
   329 
   379 
   330 link.attributes = empty
   380 link.attributes = empty