This is the RELAX NG schema for the horizontal and vertical text elements used in the Paloose site.
Included file: i18n.rng
Included file: link.rng
Included file: list.rng
Included file: graphic.rng
Included file: ../sourceWriting.rng
We can add several degrees of emphasis: weak, normal and strong. How these will appear depends on the style transformation. It can only contain a restricted set of horizontal content (foreignWord, abbrev, note, i18n:* or text).
For example
<text:p>We can add several levels of <text:emph degree="strong">emphasis</text:emph> as we wish by extending the attributes.</text:p>
<define name="text.emphElement"> <element name="text:emph"> <ref name="common.commonAttributes"/> <attribute name="degree"> <choice> <value>weak</value> <value>normal</value> <value>strong</value> </choice> </attribute> <interleave> <text/> <zeroOrMore> <choice> <ref name="text.foreignWordElement"/> <ref name="text.abbrevElement"/> <ref name="text.noteElement"/> <ref name="i18n.text"/> <ref name="text.codeElement"/> </choice> </zeroOrMore> </interleave> </element> </define>
Enclosing a set of words in another language other than the base language for the document. It provides for the language used (lang) and a translation of the word into the the base language (trans). It can only contain a restricted set of horizontal content (emph, abbrev, note, i18n:* or text).
For example
<text:foreignWord trans="Seize the day" lang="lat">carpe diem</text:foreignWord>
<define name="text.foreignWordElement"> <element name="text:foreignWord"> <ref name="common.commonAttributes"/> <optional> <attribute name="trans"/> </optional> <interleave> <text/> <zeroOrMore> <choice> <ref name="text.emphElement"/> <ref name="text.abbrevElement"/> <ref name="text.noteElement"/> <ref name="i18n.text"/> </choice> </zeroOrMore> </interleave> </element> </define>
Encloses a person's name. Often used in conjunction with the prov attriribute. It can only contain a restricted set of horizontal content (emph, abbrev, i18n:* or text).
For example
<text:who>Hugh Field-Richards</text:who>
<define name="text.whoElement"> <element name="text:who"> <ref name="common.commonAttributes"/> <interleave> <text/> <zeroOrMore> <choice> <ref name="text.emphElement"/> <ref name="text.abbrevElement"/> <ref name="i18n.text"/> </choice> </zeroOrMore> </interleave> </element> </define>
It is useful to isolate what are abbreviations. The full attribute is designed to hold the expanded version of the abbreviation. It can only contain a restricted set of horizontal content (emph, foreignWord, note, i18n:* or text).
For example
<text:abbrev full="Extensible Markup Language">XML</text:abbrev>
<define name="text.abbrevElement"> <element name="text:abbrev"> <ref name="common.commonAttributes"/> <attribute name="full"/> <interleave> <text/> <zeroOrMore> <choice> <ref name="text.emphElement"/> <ref name="text.foreignWordElement"/> <ref name="text.noteElement"/> <ref name="i18n.text"/> </choice> </zeroOrMore> </interleave> </element> </define>
This specifies that this is an inline chunk of code.
For example
<text:p>The root directory is "<text:code type="dir">/Users/</text:code>".</text:p>
<define name="text.codeElement"> <element name="text:code"> <ref name="common.commonAttributes"/> <attribute name="type"> <choice> <value>tag</value> <value>var</value> <value>dir</value> </choice> </attribute> <text/> </element> </define>
Notes provide a range of additional text annotations and can appear within selected horizontal content but can contain paragraph and verbatim vertical content. However notes may not contain other notes. What you use and do with the attribute Type values is up for you to decide.
For example
<text:note type="warning"> <text:p>Apologies to all: there was a problem with the download which gave a page not found error. This has been fixed.</text:p> </text:note>
<define name="text.noteElement"> <sch:pattern name="No nested notes."> <sch:rule context="text:note"> <sch:report test="ancestor::text:note">No nested notes</sch:report> </sch:rule> </sch:pattern> <element name="text:note"> <ref name="common.commonAttributes"/> <attribute name="type"> <choice> <value>caution</value> <value>important</value> <value>note</value> <value>footnote</value> <value>warning</value> <value>information</value> </choice> </attribute> <zeroOrMore> <choice> <ref name="text.verticalContent"/> <ref name="text.horizontalContent"/> </choice> </zeroOrMore> </element> </define>
There are occasions when a simple forced newline is required.
<define name="text.forcedLine"> <element name="text:newline"> <ref name="common.commonAttributes"/> </element> </define>
These are markers for the LaTeX engine to produce an index.
<define name="text.indexEntry"> <element name="text:index"> <ref name="common.commonAttributes"/> <attribute name="entry"> <text/> </attribute> <optional> <attribute name="see"> <text/> </attribute> </optional> <optional> <attribute name="level"> <choice> <value>main</value> <value>normal</value> </choice> </attribute> </optional> <optional> <attribute name="range"> <choice> <value>start</value> <value>finish</value> <value>following</value> </choice> </attribute> </optional> </element> </define>
Define what we mean by horizontal content.
<define name="text.horizontalContent"> <interleave> <choice> <ref name="text.forcedLine"/> <ref name="text.emphElement"/> <ref name="text.codeElement"/> <ref name="text.whoElement"/> <ref name="text.foreignWordElement"/> <ref name="text.abbrevElement"/> <ref name="text.noteElement"/> <ref name="link.linkElement"/> <ref name="i18n.text"/> <ref name="text.indexEntry"/> <text/> </choice> </interleave> </define>
A paragraph consists of any horizontal content or character text. It can only contain a restricted set of horizontal content (emph, foreignWord, note, or text).
<define name="text.pElement"> <element name="text:p"> <ref name="common.commonAttributes"/> <zeroOrMore> <ref name="text.horizontalContent"/> </zeroOrMore> </element> </define>
Extension of a simple paragraph that contains the author of the quote (who) and the type of quote (para or inline).
<define name="text.quoteElement"> <element name="text:quote"> <ref name="common.commonAttributes"/> <optional> <attribute name="who"/> </optional> <optional> <attribute name="ref"/> </optional> <attribute name="type"> <choice> <value>para</value> <value>inline</value> </choice> </attribute> <zeroOrMore> <ref name="text.horizontalContent"/> </zeroOrMore> </element> </define>
Group of horizontal or vertical content. It is provided to isolate groups of content for the style engine. In general this is not usually used in ordinary text. It can also contain a reference to an image (img), some alternate text for the image (alt) and a position (left or right).
<define name="text.groupElement"> <element name="text:group"> <ref name="common.commonAttributes"/> <optional> <attribute name="img"> <data type="string"/> </attribute> </optional> <optional> <attribute name="alt"> <data type="string"/> </attribute> </optional> <optional> <attribute name="pos"> <choice> <value>left</value> <value>right</value> </choice> </attribute> </optional> <zeroOrMore> <choice> <ref name="text.verticalContent"/> <ref name="text.horizontalContent"/> </choice> </zeroOrMore> </element> </define>
Simple headings of any level. The level is not restricted.
<define name="text.headingElement"> <element name="text:heading"> <ref name="common.commonAttributes"/> <attribute name="level"> <data type="positiveInteger"/> </attribute> <interleave> <choice> <ref name="text.forcedLine"/> <ref name="text.emphElement"/> <ref name="text.foreignWordElement"/> <ref name="text.abbrevElement"/> <ref name="i18n.text"/> <ref name="link.linkElement"/> <text/> </choice> </interleave> </element> </define>
This is a specific grouping of vertical content that can be formatted in a specific style.
<define name="text.introductionElement"> <element name="text:introduction"> <ref name="common.commonAttributes"/> <zeroOrMore> <choice> <ref name="text.pElement"/> <ref name="text.groupElement"/> <ref name="text.quoteElement"/> <ref name="text.headingElement"/> <ref name="list.listElement"/> <ref name="graphic.graphicElement"/> <ref name="i18n.text"/> </choice> </zeroOrMore> </element> </define>
Directly reproduced text honouring all spaces and newlines. It can be given a
title
. Note that any translation of tags into the
appropriate angle bracket form is done elsewhere when viewing this type of element. If
required we could add emphasis as an allowable tag here to highlight aspects of the
text. At present only the group element is allowed inside verbatim.
<define name="text.verbatimElement"> <xhtml:div> <xhtml:h2>Verbatim text</xhtml:h2> <xhtml:p> <xhtml:code>title</xhtml:code> </xhtml:p> </xhtml:div> <element name="text:verbatim"> <ref name="common.commonAttributes"/> <optional> <attribute name="title"/> </optional> <oneOrMore> <interleave> <choice> <ref name="text.groupElement"/> <ref name="text.additionElement"/> <ref name="text.deletionElement"/> <ref name="text.cmdElement"/> <text/> </choice> </interleave> </oneOrMore> </element> </define>
Marks when code has been added or changed.
<define name="text.additionElement"> <xhtml:div> <xhtml:h2>Additions text within verbatim text</xhtml:h2> <xhtml:p>Marks when code has been added or changed.</xhtml:p> </xhtml:div> <element name="text:addition"> <ref name="common.commonAttributes"/> <text/> </element> </define>
Marks when code has been deleted.
<define name="text.deletionElement"> <xhtml:div> <xhtml:h2>Deletions text within verbatim text</xhtml:h2> <xhtml:p>Marks when code has been deleted.</xhtml:p> </xhtml:div> <element name="text:deletion"> <ref name="common.commonAttributes"/> <text/> </element> </define>
Denotes a command at the user prompt in verbatim
<define name="text.cmdElement"> <xhtml:div> <xhtml:h2>User command</xhtml:h2> <xhtml:p>Denotes a command at the user prompt in verbatim</xhtml:p> </xhtml:div> <element name="text:cmd"> <ref name="common.commonAttributes"/> <text/> </element> </define>
Define what we mean by vertical content for this schema. Extend or restict this in higher schemas.
<define name="text.verticalContent"> <interleave> <zeroOrMore> <choice> <ref name="text.pElement"/> <ref name="text.noteElement"/> <ref name="text.groupElement"/> <ref name="text.quoteElement"/> <ref name="text.verbatimElement"/> <ref name="graphic.graphicElement"/> <ref name="list.listElement"/> <ref name="text.introductionElement"/> <ref name="text.headingElement"/> <ref name="source.write"/> <ref name="source.insert"/> <ref name="source.delete"/> <ref name="text.indexEntry"/> </choice> </zeroOrMore> </interleave> </define>