RelaxNG/publidoc.rnc
changeset 66 29c53c3d676e
parent 65 2aad27159a33
child 69 52c72abcc57d
equal deleted inserted replaced
65:2aad27159a33 66:29c53c3d676e
    25 
    25 
    26 document = element document { document.attributes, document.content }
    26 document = element document { document.attributes, document.content }
    27 
    27 
    28 document.attributes =
    28 document.attributes =
    29    document.id.attribute
    29    document.id.attribute
       
    30  & lang.attribute?
    30 document.id.attribute = attribute xml:id { xsd:ID }
    31 document.id.attribute = attribute xml:id { xsd:ID }
       
    32 lang.attribute = attribute xml:lang { xsd:language }
    31 
    33 
    32 document.content =
    34 document.content =
    33    top.head?,
    35    top.head?,
    34    (division | topic)+
    36    (division | topic)+
    35 
    37 
    38 top.topic = element topic { top.topic.attributes, top.topic.content }
    40 top.topic = element topic { top.topic.attributes, top.topic.content }
    39 
    41 
    40 top.topic.attributes =
    42 top.topic.attributes =
    41    topic.id.attribute
    43    topic.id.attribute
    42  & topic.type.attribute?
    44  & topic.type.attribute?
       
    45  & lang.attribute?
    43 topic.id.attribute = attribute xml:id { xsd:ID }
    46 topic.id.attribute = attribute xml:id { xsd:ID }
    44 topic.type.attribute = attribute type { xsd:NCName }
    47 topic.type.attribute = attribute type { xsd:NCName }
    45 
    48 
    46 top.topic.content =
    49 top.topic.content =
    47    top.head?,
    50    top.head?,
    61 block.head = element head { block.head.content }
    64 block.head = element head { block.head.content }
    62 
    65 
    63 top.head.content =
    66 top.head.content =
    64    (title, subtitle?)?
    67    (title, subtitle?)?
    65  & identifier*
    68  & identifier*
    66  & language?
       
    67  & copyright?
    69  & copyright?
    68  & author*
    70  & contributors?
    69  & publisher?
       
    70  & date?
    71  & date?
    71  & place?
    72  & place?
    72  & source*
    73  & source*
    73  & keywordset?
    74  & keywordset?
    74  & subjectset?
    75  & subjectset?
    79    (title, subtitle?)?
    80    (title, subtitle?)?
    80  & abstract?
    81  & abstract?
    81  & annotation*
    82  & annotation*
    82 component.head.content =
    83 component.head.content =
    83    (title, subtitle?)?
    84    (title, subtitle?)?
    84  & language?
    85  & contributors?
    85  & author*
       
    86  & abstract?
    86  & abstract?
    87  & annotation*
    87  & annotation*
    88 section.head.content =
    88 section.head.content =
    89    (title, subtitle?)?
    89    (title, subtitle?)?
    90  & abstract?
    90  & abstract?
   109    attribute type { "ean" }, xsd:token {pattern = "\d{13}"}
   109    attribute type { "ean" }, xsd:token {pattern = "\d{13}"}
   110 }
   110 }
   111 
   111 
   112 identifier = identifier.uri | identifier.ean
   112 identifier = identifier.uri | identifier.ean
   113 
   113 
   114 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   115 
       
   116 language = element language { language.attributes }
       
   117 
       
   118 language.attributes =
       
   119    lang.attribute
       
   120 lang.attribute = attribute xml:lang { xsd:language }
       
   121 
       
   122 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   114 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   123 
   115 
   124 copyright = element copyright { copyright.content }
   116 copyright = element copyright { copyright.content }
   125 
   117 
   126 copyright.content = inlines
   118 copyright.content = inlines
   127 
   119 
   128 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ author, publisher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   120 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   129 
   121 
   130 # ~~~~~~ author
   122 # ~~~~~~ contributors
   131 author = element author { author.content }
   123 contributors = element contributors { contributors.content }
   132 
   124 
   133 author.content =
   125 contributors.content =
   134    firstname?,
   126    contributor+
   135    lastname,
   127 
       
   128 # ~~~~~~ contributor
       
   129 contributor = element contributor { contributor.content }
       
   130 
       
   131 contributor.content =
       
   132    (((firstname, secondname?)?, lastname) | label),
       
   133    address?,
       
   134    link?,
   136    role*
   135    role*
   137 
   136 
   138 # ~~~~~~ publisher
   137 # ~~~~~~ firstname, secondname, lastname, label
   139 publisher = element publisher { publisher.content }
       
   140 
       
   141 publisher.content =
       
   142    label,
       
   143    link?
       
   144 
       
   145 # ~~~~~~ firstname
       
   146 firstname = element firstname { firstname.content }
   138 firstname = element firstname { firstname.content }
       
   139 secondname = element secondname { secondname.content }
       
   140 lastname = element lastname { lastname.content }
       
   141 label = element label { label.content }
   147 
   142 
   148 firstname.content = inlines
   143 firstname.content = inlines
   149 
   144 secondname.content = inlines
   150 # ~~~~~~ lastname
       
   151 lastname = element lastname { lastname.content }
       
   152 
       
   153 lastname.content = inlines
   145 lastname.content = inlines
       
   146 label.content = inlines
       
   147 
       
   148 # ~~~~~~ address
       
   149 address = element address { address.content }
       
   150 
       
   151 address.content = inlines
   154 
   152 
   155 # ~~~~~~ role
   153 # ~~~~~~ role
   156 role = element role { role.attributes }
   154 role = element role { role.content }
   157 
   155 
   158 role.attributes =
   156 role.content = "author" | "illustrator" | "publisher"
   159    role.of.attribute
       
   160 role.of.attribute = attribute of { "author" | "illustrator" }
       
   161 
       
   162 # ~~~~~~ label
       
   163 label = element label { label.content }
       
   164 
       
   165 label.content = inlines
       
   166 
   157 
   167 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   158 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   168 
   159 
   169 place = element place { place.content }
   160 place = element place { place.content }
   170 
   161