RELAX NG Schema
Last edit: 26.01.2016
- schema_current.rng
<?xml version="1.0" encoding="UTF-8"?> <!-- Version: 26.01.2016 --> <grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <start> <element name="grammar_book" xmlns="http://relaxng.org/ns/structure/1.0"> <!-- Header --> <element name="grammar_header"> <element name="gr_id"> <a:documentation>Unique index number of grammar book (integer)</a:documentation> <data type="integer" /> </element> <element name="gr_author_id"> <a:documentation>Unique index number of grammar author (integer)</a:documentation> <data type="integer" /> </element> <element name="gr_last_edit"> <a:documentation>Date of last edit</a:documentation> <attribute name="by"> <data type="string"> <param name="pattern">([A-Z].*), ([A-Z].*)</param> </data> </attribute> <data type="string"> <param name="pattern">([0-9]{2}\.[0-9]{2}\.[0-9]{4})</param> </data> </element> <element name="gr_author"><text /></element> <element name="gr_author_gender"> <choice> <value type="string">Male</value> <value type="string">Female</value> <value type="string">Other</value> <value type="string">Unknown</value> </choice> </element> <element name="gr_education"><text /></element> <element name="gr_occupation"><text /></element> <element name="gr_title"><text /></element> <element name="gr_short_title"><text /></element> <optional> <element name="gr_title_add"><text /> <a:documentation>Additional notes on title page</a:documentation> </element> </optional> <element name="gr_publisher"><text /></element> <element name="gr_place_of_publication"><text /></element> <element name="gr_year_publication"><text /></element> <element name="gr_year_edition"><text /></element> <element name="gr_no_edition"><text /></element> <element name="gr_no_of_pages"><text /> <a:documentation>Number of physically existent pages</a:documentation> </element> <element name="gr_no_of_words"><text /> <a:documentation>Currently an approximation of the number of words</a:documentation> </element> <element name="gr_language"> <choice> <value type="string">English</value> <value type="string">French</value> <value type="string">German</value> <value type="string">Latin</value> <value type="string">Other</value> </choice> </element> <element name="gr_variety"> <choice> <value type="string">British English</value> <value type="string">American English</value> <value type="string">Unknown</value> <value type="string">Other</value> </choice> </element> <element name="gr_type"> <a:documentation>Type of grammar, e.g. Teaching Grammar, Scholarly Grammar</a:documentation> <data type="string"> <param name="pattern"> *(Teaching Grammar|Scholarly Grammar|Entertainment Grammar|Other|Unknown)(, *(Teaching Grammar|Scholarly Grammar|Entertainment Grammar|Other|Unknown))*</param> </data> </element> <element name="gr_form"> <a:documentation>Form of grammar, e.g. Textbook, Catechism</a:documentation> <choice> <value type="string">Textbook</value> <value type="string">Catechism</value> <value type="string">Treatise</value> <value type="string">Letter/s</value> <value type="string">Children's Story</value> <value type="string">Verse</value> <value type="string">Unknown</value> <value type="string">Other</value> </choice> </element> <element name="gr_target_audience"> <data type="string"> <param name="pattern"> *(School|College|University|Church|Family|Self Study|Other|Unknown|None)(, *(School|College|University|Church|Family|Self Study|Other|Unknown|None))*</param> </data> </element> <element name="gr_level"> <choice> <value type="string">Beginner</value> <value type="string">Beginner, Intermediate</value> <value type="string">Intermediate</value> <value type="string">Intermediate, Advanced</value> <value type="string">Advanced</value> <value type="string">Unknown</value> <value type="string">Other</value> </choice> </element> <element name="gr_target_audience_author"> <a:documentation>Target audience according to the author</a:documentation> <text /> </element> <optional> <element name="gr_no_of_editions"><text /></element> </optional> <optional> <element name="gr_ed_note"> <a:documentation>Additional editorial commentaries</a:documentation> <text /> </element> </optional> <optional> <element name="gr_tags"> <a:documentation>A comma separated list of tags</a:documentation> <text /> </element> </optional> </element> <!-- Grammar Text --> <element name="grammar_text"> <oneOrMore> <zeroOrMore> <ref name="global"/> </zeroOrMore> <element name="div0"> <a:documentation>Main divisions of grammar, i.e. Front Matter, Main Body, Back Matter</a:documentation> <optional> <attribute name="name"/> </optional> <attribute name="description"> <choice> <value type="string">front_matter</value> <value type="string">main_body</value> <value type="string">back_matter</value> </choice> </attribute> <zeroOrMore> <optional> <ref name="paragraph"/> </optional> <zeroOrMore> <ref name="global"/> </zeroOrMore> <ref name="prosody" /> <optional> <element name="div1"> <optional> <attribute name="name"/> </optional> <optional> <attribute name="description"> <choice> <value type="string">preface</value> <value type="string">advertisment</value> <value type="string">dedication</value> <value type="string">table_of_contents</value> <value type="string">index</value> <value type="string">appendix</value> <value type="string">initial quotation</value> <value type="string">main_text</value> <value type="string">exercises</value> <value type="string">imprint</value> <value type="string">title_page</value> </choice> </attribute> </optional> <zeroOrMore> <optional> <element name="div2"> <a:documentation>Smaller subdivisions of div1, e.g. chapters</a:documentation> <optional> <attribute name="name"/> </optional> <optional> <attribute name="description"> <choice> <value type="string">preface</value> <value type="string">advertisment</value> <value type="string">dedication</value> <value type="string">table_of_contents</value> <value type="string">index</value> <value type="string">appendix</value> <value type="string">initial quotation</value> <value type="string">main_text</value> <value type="string">exercises</value> <value type="string">imprint</value> <value type="string">title_page</value> </choice> </attribute> </optional> <ref name="global" /> <zeroOrMore> <optional> <zeroOrMore> <ref name="global"/> </zeroOrMore> <ref name="prosody" /> <optional> <ref name="paragraph"/> </optional> </optional> <optional> <element name="div3"> <a:documentation>Smaller subdivisions of div2, e.g. subchapters</a:documentation> <optional> <attribute name="name"/> </optional> <optional> <attribute name="description"> <choice> <value type="string">preface</value> <value type="string">advertisment</value> <value type="string">dedication</value> <value type="string">table_of_contents</value> <value type="string">index</value> <value type="string">appendix</value> <value type="string">initial quotation</value> <value type="string">main_text</value> <value type="string">exercises</value> <value type="string">imprint</value> <value type="string">title_page</value> </choice> </attribute> </optional> <zeroOrMore> <optional> <zeroOrMore> <ref name="global"/> </zeroOrMore> <zeroOrMore> <ref name="paragraph"/> </zeroOrMore> <zeroOrMore> <ref name="prosody" /> </zeroOrMore> </optional> </zeroOrMore> </element> </optional> </zeroOrMore> </element> </optional> <optional> <zeroOrMore> <ref name="global"/> </zeroOrMore> </optional> <optional> <ref name="paragraph"/> <zeroOrMore> <ref name="global"/> </zeroOrMore> <ref name="prosody" /> </optional> </zeroOrMore> </element> </optional> </zeroOrMore> </element> </oneOrMore> </element> </element> </start> <!-- Prosody --> <define name="prosody"> <zeroOrMore> <text/> <optional> <element name="lg"> <a:documentation>Group of lines that form a prosodic unit, e.g. a stanza</a:documentation> <attribute name="met" /> <attribute name="rhyme"> <data type="string"> <param name="pattern">([A-Za-z]*)</param> </data> </attribute> <zeroOrMore> <ref name="global"/> </zeroOrMore> <oneOrMore> <element name="l"> <optional> <attribute name="met"> <a:documentation>Metre of line as given</a:documentation> <data type="string"> <param name="pattern">([\+\-]*)</param> </data> </attribute> </optional> <optional> <attribute name="real"> <a:documentation>Real metre of line</a:documentation> <data type="string"> <param name="pattern">([\+\-]*)</param> </data> </attribute> </optional> <zeroOrMore> <ref name="global"/> </zeroOrMore> <text/> </element> </oneOrMore> </element> </optional> </zeroOrMore> <zeroOrMore> <text/> <optional> <element name="l"> <optional> <attribute name="real"> <a:documentation>Real metre of line</a:documentation> <data type="string"> <param name="pattern">([\+\-]*)</param> </data> </attribute> </optional> <optional> <attribute name="met"> <a:documentation>Metre of line as given</a:documentation> <data type="string"> <param name="pattern">([\+\-]*)</param> </data> </attribute> </optional> <zeroOrMore> <ref name="global"/> </zeroOrMore> <text/> </element> </optional> </zeroOrMore> </define> <!-- Paragraph --> <define name="paragraph"> <element name="paragraph"> <a:documentation>Group of lines that form a content unit. Often, but not necessarily corresponding to the layout of the text.</a:documentation> <optional> <attribute name="type"> <choice> <value type="string">exercise</value> <value type="string">example</value> <value type="string">footnote</value> </choice> </attribute> </optional> <zeroOrMore> <ref name="global"/> <ref name="structural_elements" /> <ref name="prosody" /> </zeroOrMore> </element> </define> <!-- Global --> <define name="global"> <ref name="inline"/> <text/> <optional> <ref name="prosody" /> </optional> <optional> <element name="pagebreak"> <a:documentation>Marks a new page, but no splitting of words</a:documentation> <attribute name="page_no"> <a:documentation>Number of following page, only if given.</a:documentation> </attribute> <empty/> </element> </optional> <optional> <element name="linebreak"> <a:documentation>Marks a new line, but no splitting of words</a:documentation> <empty/> </element> </optional> <zeroOrMore> <text/> <optional> <element name="ed_note"> <a:documentation>Editor's note: either note, addition, omission, or correction (e.g. typos). Within the element, the uncorrected form of a word is noted, so that the correct form is counted. </a:documentation> <attribute name="type"> <choice> <value type="string">note</value> <value type="string">addition</value> <value type="string">correction</value> <value type="string">omission</value> </choice> </attribute> <text/> <ref name="global" /> </element> </optional> </zeroOrMore> <text/> <zeroOrMore> <text/> <optional> <element name="quotation"> <a:documentation>Quotation by other author</a:documentation> <attribute name="author"><text /></attribute> <optional> <attribute name="title"><text /></attribute> </optional> <attribute name="source_added"> <a:documentation>Boolean variable; 0 when source is explictly mentioned, 1 when source was added by the editors.</a:documentation> <data type="integer"> <param name="pattern">([0-1])</param> </data> </attribute> <zeroOrMore> <ref name="global"/> </zeroOrMore> <zeroOrMore> <ref name="paragraph"/> </zeroOrMore> <text/> </element> </optional> </zeroOrMore> <zeroOrMore> <text/> <optional> <element name="reference"> <a:documentation>Indicates referenced author. The element encapsulates the author's name and title.</a:documentation> <attribute name="type"> <choice> <value type="string">reference</value> <value type="string">quotation</value> <value type="string">dedication</value> <value type="string">legitimisation</value> <value type="string">criticism</value> <value type="string">agreement</value> <value type="string">other</value> <value type="string">unknown</value> </choice> </attribute> <attribute name="judgemental"> <choice> <value type="integer">1</value> <value type="integer">0</value> </choice> </attribute> <optional> <attribute name="referencing"> <a:documentation>The person who references another author or grammar. Default = Grammar's author</a:documentation> <data type="string"> <param name="pattern">([A-Z].*), ([A-Z].*)</param> </data> </attribute> </optional> <attribute name="referenced"> <a:documentation>The person who is being referenced.</a:documentation> <data type="string" /> </attribute> <optional> <attribute name="source"> <a:documentation>Title and year of publication in brackets</a:documentation> <data type="string" /> </attribute> </optional> <zeroOrMore> <ref name="global"/> </zeroOrMore> <text/> </element> </optional> </zeroOrMore> <zeroOrMore> <text/> <optional> <element name="judgement"> <a:documentation>Judgemental statements by the author on other authors, grammars, society, etc. Single words, phrases, or sentences.</a:documentation> <attribute name="tedency"> <choice> <value type="string">positive</value> <value type="string">negative</value> </choice> </attribute> <attribute name="type"> <choice> <value type="string">praise</value> <value type="string">acknowledgment</value> <value type="string">consent</value> <value type="string">correction</value> <value type="string">dissent</value> <value type="string">derogation</value> <value type="string">insult</value> </choice> </attribute> <optional> <attribute name="addressee_explicit"> <text/> </attribute> </optional> <optional> <attribute name="addressee_implicit"> <text/> </attribute> </optional> <zeroOrMore> <ref name="global"/> </zeroOrMore> <text/> </element> </optional> </zeroOrMore> <zeroOrMore> <text/> <optional> <element name="heading"> <attribute name="level"> <a:documentation>The highest hierarchical level of headings is 1.</a:documentation> <data type="integer"> <param name="pattern">([1-99]{1,3})</param> </data> </attribute> <zeroOrMore> <ref name="global"/> </zeroOrMore> <text/> </element> </optional> </zeroOrMore> <zeroOrMore> <text/> <optional> <element name="heading_undefined"> <a:documentation>A heading without an identifiable level</a:documentation> <zeroOrMore> <ref name="global"/> </zeroOrMore> <text/> </element> </optional> </zeroOrMore> <zeroOrMore> <text/> <optional> <element name="gap"> <a:documentation>A gap within a gap-fill exercise</a:documentation> <text/> </element> </optional> </zeroOrMore> <zeroOrMore> <text/> <optional> <element name="folio"> <a:documentation>A folio number</a:documentation> <attribute name="folio_no"><text /></attribute> <empty /> </element> </optional> </zeroOrMore> </define> <!-- Structural Elements --> <define name="structural_elements"> <zeroOrMore> <element name="list"> <a:documentation> A table with a single column. Attribute "rend" (simple/bulleted/numbered) refers to the type of list. A list can have its own "head". Single list elements are called "items" and can have optional "labels". </a:documentation> <attribute name="rend"> <choice> <value type="string">simple</value> <value type="string">bulleted</value> <value type="string">numbered</value> </choice> </attribute> <optional> <element name="head"> <data type="NCName"/> </element> </optional> <oneOrMore> <choice> <element name="item"> <text/> <zeroOrMore> <ref name="global"/> </zeroOrMore> </element> <element name="label"> <text/> <zeroOrMore> <ref name="global"/> </zeroOrMore> </element> <ref name="global" /> </choice> </oneOrMore> </element> </zeroOrMore> <zeroOrMore> <element name="graphic"> <attribute name="image_id"> <a:documentation>Unique index number of graphic within the particular grammar</a:documentation> <data type="integer"/> </attribute> <optional> <attribute name="image_title"></attribute> </optional> <optional> <attribute name="page"> <data type="integer"/> </attribute> </optional> <attribute name="url"> <a:documentation>/images/grammarid_imageid.filetype</a:documentation> <data type="string"> <param name="pattern">(images/[0-9]{1,5}_[0-9]{1,5}\..{3})</param> </data> </attribute> <attribute name="desc" /> <attribute name="filetype"> <choice> <value type="string">png</value> <value type="string">jpg</value> <value type="string">gif</value> <value type="string">svg</value> <value type="string">bmp</value> </choice> </attribute> </element> </zeroOrMore> <zeroOrMore> <element name="toc"> <a:documentation>Table of Contents; Contains "level", "section_name" (e.g. chapter headings), and "page_no" for every "entry".</a:documentation> <oneOrMore> <element name="entry"> <attribute name="level"> <data type="integer"> <param name="pattern">([1-99]{1,3})</param> </data> </attribute> <element name="section_name"> <text /> <zeroOrMore> <ref name="global"/> </zeroOrMore> </element> <optional> <element name="page_no"><text /></element> </optional> <zeroOrMore> <ref name="global"/> </zeroOrMore> </element> <ref name="global" /> </oneOrMore> </element> </zeroOrMore> <zeroOrMore> <element name="table"> <attribute name="cols"> <a:documentation>Number of columns</a:documentation> <data type="integer"/> </attribute> <attribute name="rows"> <a:documentation>Number of rows</a:documentation> <data type="integer"/> </attribute> <optional> <element name="head"> <ref name="inline"/> <text/> </element> </optional> <optional> <element name="sub_head"> <ref name="inline"/> <text/> </element> </optional> <oneOrMore> <zeroOrMore> <ref name="global"/> </zeroOrMore> <element name="row"> <zeroOrMore> <ref name="global"/> </zeroOrMore> <optional> <attribute name="role"> <a:documentation>Either heading or data</a:documentation> <choice> <value type="string">heading</value> <value type="string">data</value> </choice> </attribute> </optional> <oneOrMore> <element name="cell"> <optional> <attribute name="role"> <a:documentation>Either heading or data</a:documentation> <choice> <value type="string">heading</value> <value type="string">data</value> </choice> </attribute> </optional> <zeroOrMore> <ref name="global"/> </zeroOrMore> <zeroOrMore> <ref name="structural_elements"/> </zeroOrMore> </element> </oneOrMore> </element> </oneOrMore> </element> </zeroOrMore> <zeroOrMore> <element name="tree"> <attribute name="arity"> <a:documentation>Maximum number of children a node can have</a:documentation> <data type="integer"/> </attribute> <attribute name="ord"> <a:documentation>Whether the child nodes are ordered or not</a:documentation> <choice> <value type="string">true</value> <value type="string">false</value> <value type="string">partial</value> </choice> </attribute> <attribute name="order"> <a:documentation>Number of nodes without the root node</a:documentation> <data type="integer"/> </attribute> <element name="root"> <attribute name="ref_node"> <a:documentation>Index of node ("R" for root)</a:documentation> <data type="string"> <param name="pattern">([A-Z]{1})</param> </data> </attribute> <attribute name="children"> <a:documentation>Children of node</a:documentation> <data type="string"> <param name="pattern"> *(#[A-Z][0-9])( *(#[A-Z][0-9]))*</param> </data> </attribute> <element name="label"> <text/> <ref name="inline"/> </element> </element> <oneOrMore> <element name="leaf"> <attribute name="ref_node"> <a:documentation>Index of node ("R" for root)</a:documentation> <data type="string"> <param name="pattern">([A-Z][0-9])</param> </data> </attribute> <attribute name="parent"> <a:documentation>Parent of node</a:documentation> <data type="string"> <param name="pattern">(#[A-Z].*)</param> </data> </attribute> <element name="label"> <text/> <ref name="inline"/> </element> </element> </oneOrMore> </element> </zeroOrMore> </define> <!-- Inline --> <define name="inline"> <text/> <zeroOrMore> <text /> <optional> <element name="bold"> <zeroOrMore> <ref name="global"/> </zeroOrMore> </element> </optional> </zeroOrMore> <zeroOrMore> <text /> <optional> <element name="italic"> <zeroOrMore> <ref name="global"/> </zeroOrMore> </element> </optional> </zeroOrMore> <zeroOrMore> <text /> <optional> <element name="underline"> <zeroOrMore> <ref name="global"/> </zeroOrMore> </element> </optional> </zeroOrMore> <text /> <zeroOrMore> <text /> <optional> <element name="footnote"> <a:documentation>Footnotes replace footnote symbols with the respective texts. They can contain paragraphs, but not pagebreaks. The "indicator" is replaced by the footnote and is added as an attribute.</a:documentation> <attribute name="indicator"> <a:documentation>The symbol that indicates / refers to the footnote</a:documentation> <choice> <value type="string">Number</value> <value type="string">Dagger</value> <value type="string">Double Dagger</value> <value type="string">Cross</value> <value type="string">Asterisk</value> <value type="string">Pillcrow</value> <value type="string">Section Sign</value> <value type="string">Double Vertical Line</value> <value type="string">Three Dots</value> </choice> </attribute> <zeroOrMore> <ref name="global"/> </zeroOrMore> <zeroOrMore> <ref name="paragraph"/> </zeroOrMore> </element> </optional> </zeroOrMore> <zeroOrMore> <text /> <optional> <element name="small_caps"> <zeroOrMore> <ref name="global"/> </zeroOrMore> </element> </optional> </zeroOrMore> <zeroOrMore> <text /> <optional> <element name="foreign"> <a:documentation>Text elements containing foreign language text.</a:documentation> <attribute name="language"> <choice> <value type="string">latin</value> <value type="string">greek</value> <value type="string">french</value> <value type="string">german</value> <value type="string">italian</value> <value type="string">spanish</value> <value type="string">hebrew</value> <value type="string">chinese</value> </choice> </attribute> <zeroOrMore> <ref name="global"/> </zeroOrMore> <text/> </element> </optional> </zeroOrMore> <zeroOrMore> <text /> <optional> <element name="language_period"> <a:documentation>Contains language from former periods of English.</a:documentation> <attribute name="period"> <choice> <value type="string">Old English</value> <value type="string">Middle English</value> <value type="string">Early Modern English</value> </choice> </attribute> <zeroOrMore> <ref name="global"/> </zeroOrMore> <text/> </element> </optional> </zeroOrMore> </define> </grammar>