diff -r ca367d4d080b -r e448c6a000e5 RelaxNG/publidoc.rnc --- a/RelaxNG/publidoc.rnc sam. juin 11 20:35:18 2011 +0200 +++ b/RelaxNG/publidoc.rnc dim. juin 12 14:17:23 2011 +0200 @@ -30,12 +30,12 @@ document.id.attribute = attribute xml:id { xsd:ID } document.content = - metadata?, + top.metadata?, (division+ | topic+) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -top.topic = element topic { top.topic.attributes, topic.content } +top.topic = element topic { top.topic.attributes, top.topic.content } # ============================================================================= @@ -44,28 +44,49 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ metadata ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -metadata = element metadata { metadata.content } +top.metadata = element metadata { top.metadata.content } +division.metadata = element metadata { division.metadata.content } +component.metadata = element metadata { component.metadata.content } +section.metadata = element metadata { section.metadata.content } -metadata.content = - title - & subtitle? +top.metadata.content = + (title, subtitle?)? + & language? & author* & publisher? - & language? & date? & place? & source* & subjectset? & abstract? & annotation* +division.metadata.content = + (title, subtitle?)? + & language? + & annotation* +component.metadata.content = + (title, subtitle?)? + & language? + & author* + & annotation* +section.metadata.content = + (title, subtitle?)? + & language? + & annotation* # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title = element title { title.content } +subtitle = element subtitle { title.content } title.content = inlines -subtitle = element subtitle { title.content } +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +language = element language { language.attributes } + +language.attributes = lang.attribute +lang.attribute = attribute xml:lang { xsd:language } # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ author, publisher ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -91,13 +112,6 @@ lastname.content = inlines -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Language ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -language = element language { language.attributes } - -language.attributes = lang.attribute -lang.attribute = attribute xml:lang { xsd:language } - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place = element place { place.content } @@ -169,7 +183,7 @@ division = element division { division.content } division.content = - metadata?, + division.metadata?, (division+ | topic+) @@ -190,8 +204,11 @@ topic.id.attribute = attribute xml:id { xsd:ID } topic.type.attribute = attribute type { xsd:NCName } +top.topic.content = + top.metadata?, + section+ topic.content = - metadata?, + component.metadata?, section+ @@ -204,7 +221,7 @@ section = element section { section.content, section.attributes } section.content = - metadata?, + section.metadata?, (section+ | block+) section.attributes = @@ -218,7 +235,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -block = (parag | \list | table | speech | media) +block = (parag | speech | \list | table | media) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ parag ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -228,6 +245,26 @@ inlines & link* +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# ~~~~~~ speech +speech = element speech { speech.content } + +speech.content = + speaker?, + stage?, + parag+ + +# ~~~~~~ speaker +speaker = element speaker { speaker.content } + +speaker.content = inlines + +# ~~~~~~ stage +stage = element stage { stage.content } + +stage.content = inlines + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ list @@ -317,26 +354,6 @@ caption.content = parag+ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# ~~~~~~ speech -speech = element speech { speech.content } - -speech.content = - speaker?, - stage?, - parag+ - -# ~~~~~~ speaker -speaker = element speaker { speaker.content } - -speaker.content = inlines - -# ~~~~~~ stage -stage = element stage { stage.content } - -stage.content = inlines - # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ media