![]() Relax NG Schema for CSTUG Bulletin v. 1.0Table of contents
This is a Relax NG schema for CSTUG bulletin table of contents, abstracts
and keywords. The elements will have its own namespace
The schema contains Schematron 1.3 assertions intended for use with As you will se later, information is often spread accross several files. The assertions verify only data items which must always link to the same file. Some conditions are therefore not validated but there is not a great risk that they will be wrong.
The assertions do not verify that the author and keyword id's refer to existing information in the
respective file although it could be implemented. Use the stylesheet
The schema is used for the whole group of documents. The
The schema is documented via elements from a special namespace. A processing instruction links a
stylesheet designed for pretty-printing in Mozilla. It works partially even in MS Internet Explorer
but nesting of the code is lost. The Please do not save this file alone. It requires a stylesheet for pretty-printing. You can find all files zipped into a single archive at http://bulletin.cstug.cz/xml. <define name="def.index">The information will always be spread to several XML files. Their home location is, as written above, http://bulletin.cstug.cz/xml. However, we would like to allow their placement in private local copies, redistribution on a CD or DVD etc. In order to make it easier, there will always be an index document containing the links to other files. The first four attributes mean:
base attribute. The templates in the supplied stylesheets obtain the URL as
<xsl:value-of select='concat(@base, @toc)'/> . The element optionally contains the
date and time of last modification. The contents is empty. All linked files must point back to the
index document by an indexhref attribute.
The pattern is used in: <define name="def.index"> <element name="index"> <attribute name="toc"> <data type="anyURI"/> </attribute> <attribute name="keywords"> <data type="anyURI"/> </attribute> <attribute name="authors"> <data type="anyURI"/> </attribute> <attribute name="acronyms"> <data type="anyURI"/> </attribute> <optional> <attribute name="base"> <data type="anyURI"/> </attribute> </optional> <optional> <ref name="def.lastmod"/> </optional> <empty/> </element> </define> <define name="xincl">The contents of some elements may be either present in the same file or may be included from another file. Inclusion will use standard XML mechanisms. We will therefore need a subset of XInclude. The pattern is used in: <define name="xincl"> <element name="include" ns="http://www.w3c.org/2001/XInclude"> <attribute name="href"> <data type="anyURI"/> </attribute> <optional> <attribute name="parseType"> <value>xml</value> </attribute> </optional> </element> </define> <define name="def.lang.attr">
Some elements need information on language. We will make advantage of the The pattern is used in: <define name="def.lang.attr"> <attribute name="lang"> <choice> <value>cze</value> <value>slo</value> <value>eng</value> <value>ger</value> </choice> </attribute> </define> <define name="def.id">Some elements require a token as its ID. The pattern is used in: <define name="def.id"> <attribute name="id"> <data type="NMTOKEN"/> </attribute> </define> <define name="def.xhref">
Each principal element (the one which can appear in The pattern is used in:
<define name="def.xhref"> <attribute name="indexhref"> <data type="anyURI"/> </attribute> </define> <define name="def.lastmod">Some elements may optionally have an attribute containing the date (and time) of the last modification according to ISO 8601. It is allowed to specify either the date or the full time. The time is used to distinguis several releases within the same day. The attribute represents the date/time when the document was physically modified. It may differ from the file timestamp. The pattern is used in:
<define name="def.lastmod"> <attribute name="lastModified"> <choice> <data type="dateTime"/> <data type="date"/> </choice> </attribute> </define> <define name="def.acrolist">The list of acronyms is used to store associations of the ID's and real texts. The root element must contain a link to the index file. The pattern is used in: <define name="def.acrolist"> <element name="acronymList"> <ref name="def.xhref"/> <ref name="def.lastmod"/> <zeroOrMore> <ref name="def.acronym"/> </zeroOrMore> </element> </define> <define name="def.acronym">
Each acronym assigns an ID's to the HTML and TEX representation of logos. The text version is
used in the plain text output and as a sort key. Optional The pattern is used in: <define name="def.acronym"> <element name="acronym"> <ref name="def.id"/> <interleave> <ref name="def.TeX"/> <ref name="def.html"/> <ref name="def.text"/> <optional> <ref name="def.meaning"/> </optional> </interleave> <s:report test="following-sibling::node()/@id = @id"> The "id" attribute of the "acronym" element must be unique. </s:report> </element> </define> <define name="def.TeX">The TEX part may contain text and references to other acronyms. The pattern is used in: <define name="def.TeX"> <element name="TeX"> <ref name="text.or.acro"/> </element> </define> <define name="def.html">The HTML part can contain any markup from namespaces different from this one. References to other acronyms can also be used. The pattern is used in: <define name="def.html"> <element name="html"> <oneOrMore> <ref name="def.html.content"/> </oneOrMore> </element> </define> <define name="def.html.content">
The content model for the The pattern is used in: <define name="def.html.content"> <choice> <text/> <element> <anyName> <except> <nsName/> </except> </anyName> <zeroOrMore> <ref name="def.html.content"/> </zeroOrMore> </element> <ref name="def.acro"/> </choice> </define> <define name="def.text">The text part may only contain plain text. The pattern is used in: <define name="def.text"> <element name="text"> <text/> </element> </define> <define name="def.meaning">The meaning may only contain plain text. The pattern is used in: <define name="def.meaning"> <element name="meaning"> <text/> </element> </define> <define name="def.acro">The contents of the reference to an acronym will be the acronym's ID. We decided to put the ID to the contents instead of the attribute so that users, who do not process the document with our stylesheets which expadn references, see at least something. The pattern is used in: <define name="def.acro"> <element name="acro"> <data type="NMTOKEN"/> </element> </define> <define name="text.or.acro">The following pattern will be used repeatedly. The pattern is used in:
<define name="text.or.acro"> <oneOrMore> <choice> <text/> <ref name="def.acro"/> </choice> </oneOrMore> </define> <define name="def.kwdlist">The keywords are stored in their own file. The root element must contain a link to the index file. The pattern is used in: <define name="def.kwdlist"> <element name="keywordList"> <ref name="def.xhref"/> <ref name="def.lastmod"/> <zeroOrMore> <ref name="def.keyword"/> </zeroOrMore> </element> </define> <define name="def.keyword">Each keyword has its (human readable) identifier and text which may refer to an acronym. The Czech text is mandatory, the English and Slovak translations are optional. The name of the child element is taken from the 3-letter language code according to ISO 639-2. However, the acronyms or product names have the same form in all languages. In such a case we use the alement named ALL. No other language variants are then allowed. You can make use of one of the supplied stylesheets:
The keyword ID must be unique. The pattern is used in: <define name="def.keyword"> <element name="keyword"> <ref name="def.id"/> <choice> <element name="ALL"> <ref name="text.or.acro"/> </element> <interleave> <element name="cze"> <ref name="text.or.acro"/> </element> <optional> <element name="slo"> <ref name="text.or.acro"/> </element> </optional> <optional> <element name="eng"> <ref name="text.or.acro"/> </element> </optional> </interleave> </choice> <s:report test="following-sibling::node()/@id = @id"> The "id" attribute of the "keyword" element must be unique. </s:report> </element> </define> <define name="def.authlist">The list of authors is used to replace author names with ID's. The root element must contain a link to the index file. The pattern is used in: <define name="def.authlist"> <element name="authorList"> <ref name="def.xhref"/> <ref name="def.lastmod"/> <zeroOrMore> <ref name="def.author"/> </zeroOrMore> </element> </define> <define name="def.author">The author's ID must be a NMTOKEN which can be used for sorting. The surname, first name nad initials may contain references to acronyms. The full name can sometimes be expressed as an acronym. In such cases this optional child is preferred to concatenation of the initials and he surname. Again the author ID must be unique. The pattern is used in: <define name="def.author"> <element name="author"> <ref name="def.id"/> <interleave> <element name="surname"> <ref name="text.or.acro"/> </element> <element name="firstname"> <ref name="text.or.acro"/> </element> <element name="initials"> <ref name="text.or.acro"/> </element> <optional> <element name="fullname"> <ref name="text.or.acro"/> </element> </optional> </interleave> <s:report test="following-sibling::node()/@id = @id"> The "id" attribute of the "author" element must be unique. </s:report> </element> </define> <define name="def.toc">The main table of contents will be in its own file. The volumes may be directly present in the element or included via XInclude. The ISSN* elements have fixed values. The pattern is used in: <define name="def.toc"> <element name="toc"> <ref name="def.xhref"/> <optional> <ref name="def.lastmod"/> </optional> <attribute name="ISSNprinted"> <value>1211-6661</value> </attribute> <attribute name="ISSNonline"> <value>1213-8185</value> </attribute> <zeroOrMore> <choice> <ref name="xincl"/> <ref name="def.volume"/> </choice> </zeroOrMore> </element> </define> <define name="def.volume">
Each volume can be stored in its own file, therefore it must contain the link to the index file.
This link is usually unused if the elements are contained within the toc file as children of the
The pattern is used in: <define name="def.volume"> <element name="volume"> <ref name="def.xhref"/> <optional> <ref name="def.lastmod"/> </optional> <attribute name="year"> <ref name="def.year.type"/> </attribute> <attribute name="id"> <ref name="def.year.type"/> </attribute> <attribute name="volume"> <data type="positiveInteger"/> </attribute> <zeroOrMore> <choice> <ref name="xincl"/> <ref name="def.issue"/> </choice> </zeroOrMore> <s:assert test="@year = @id"> The "year" and "id" attributes of the "volume" element must be equal. </s:assert> <s:assert test="@year - 1990 = @volume"> The "volume" attributes of the "volume" element is incorrect. </s:assert> </element> </define> <define name="def.year.type">The year and the ID of the volume will share the same type. The pattern is used in: <define name="def.year.type"> <data type="positiveInteger"> <param name="minInclusive">1991</param> </data> </define> <define name="def.issue">Each issue can appear in its own file or can be present in the file of The element contains a few Schematron assertions. Notice that sometimes the last article may end at the cover page which is traditionally reserved just for the colophon. Thus the number of pages need not be strictly divisible by 4. The pattern is used in: <define name="def.issue"> <element name="issue"> <ref name="def.xhref"/> <ref name="def.issue.id"/> <ref name="def.issue.num"/> <attribute name="href"> <data type="anyURI"/> </attribute> <optional> <ref name="def.lastmod"/> </optional> <optional> <attribute name="pdfref"> <data type="anyURI"/> </attribute> </optional> <optional> <attribute name="firstPage"> <data type="positiveInteger"/> </attribute> <attribute name="lastPage"> <data type="positiveInteger"/> </attribute> </optional> <oneOrMore> <ref name="def.article"/> </oneOrMore> <s:assert test="substring-after(@id, "/") = @num"> The "id" and "num" attributes have conflicting values. </s:assert> <s:assert test="not(contains(@num, "-")) or number(substring-before(@num, "-")) < number(substring-after(@num, "-"))"> The number of a multiple issue is invalid. </s:assert> <s:assert test="not(@firstPage) or @firstPage < @lastPage"> The last page must be greater than the first page. </s:assert> <s:assert test="not(@firstPage) or (@lastPage - @firstPage + 1) mod 4 <= 1"> The number of pages must be divisible by 4. </s:assert> </element> </define> <define name="def.issue.num">Sometimes several issues are published together, thus the number is defined by the following pattern. The pattern is used in: <define name="def.issue.num"> <attribute name="num"> <data type="string"> <param name="pattern">[1-4](-[2-4])?</param> </data> </attribute> </define> <define name="def.issue.id">This is the pattern for the issue ID as discussed above. The pattern is used in: <define name="def.issue.id"> <attribute name="id"> <data type="string"> <param name="pattern">[0-9]{4}/[1-4](-[2-4])?</param> </data> </attribute> </define> <define name="def.article">The articles are usually included in the The The pattern is used in: <define name="def.article"> <element name="article"> <ref name="def.lang.attr"/> <attribute name="serial"> <data type="positiveInteger"/> </attribute> <ref name="art.id"/> <attribute name="firstPage"> <data type="positiveInteger"/> </attribute> <optional> <attribute name="lastPage"> <data type="positiveInteger"/> </attribute> </optional> <optional> <attribute name="year"> <ref name="def.year.type"/> </attribute> <attribute name="volume"> <data type="positiveInteger"/> </attribute> <ref name="def.issue.num"/> </optional> <optional> <attribute name="href"> <data type="anyURI"/> </attribute> </optional> <ref name="def.article.content"/> <s:assert test="@serial = substring-after(@id, "#")"> The "serial" and "id" attributes are in conflict. </s:assert> <s:assert test="not (parent::node()[local-name() = "issue"]) or not (preceding-sibling::node()[local-name() = "article"]) or number(@serial) = 1 + number(preceding-sibling::node()[local-name()="article"][1]/@serial)"> The "serial" attribute is not an increment. </s:assert> <s:assert test="not (parent::node()[local-name() = "issue"]) or preceding-sibling::node()[local-name()="article"] or @serial = 1"> The first "article" element must have serial="1". </s:assert> <s:assert test="not(@num) or not(contains(@num, "-")) or number(substring-before(@num, "-")) < number(substring-after(@num, "-"))"> The number of a multiple issue within "article" is invalid. </s:assert> <s:assert test="not(@num) or concat(@year, "/", @num, "#", @serial) = @id"> The "year", "num", "serial", and "id" attributes of the "article" element are in conflict. </s:assert> <s:report test="@lastPage and number(@lastPage) < number(@firstPage)"> The last page of the "article" must not be less than the first page. </s:report> <s:report test="parent::node()[local-name() = "issue"] and preceding-sibling::node()[local-name() = "article"] and number(@firstPage) < number(preceding-sibling::node()[local-name() = "article"]/@firstPage)"> Page numbering conflict (first page). </s:report> <s:report test="parent::node()[local-name() = "issue"] and preceding-sibling::node()[local-name() = "article"] and number(@firstPage) < number(preceding-sibling::node()[local-name() = "article"]/@lastPage)"> Page numbering conflict (last page). </s:report> </element> </define> <define name="art.id">The article ID consists of the issue ID followed by the hash mark and the serial number. The pattern is used in: <define name="art.id"> <attribute name="id"> <data type="string"> <param name="pattern">[0-9]{4}/[1-4](-[2-4])?#[0-9]+</param> </data> </attribute> </define> <define name="def.article.content">The article must always have a title in the main language. Author(s), keyword(s) and abstract(s) are optional. If the titles and abstracts are present in several languages, they must always be given as adjacent elements. The pattern is used in: <define name="def.article.content"> <interleave> <ref name="article.title"/> <ref name="article.authors"/> <ref name="article.abstract"/> <ref name="article.keywords"/> </interleave> </define> <define name="article.title">The title must contain the language specification (it is the language of the title). Its text may contain references to acronyms. If the language of the article is not English, we often provide an English translation of the title. In the future we wish to translate most titles into English, even if the translation does not appear in the bulletin. The titles in a particular language must not be duplicated. The pattern is used in: <define name="article.title"> <oneOrMore> <element name="title"> <ref name="def.lang.attr"/> <ref name="text.or.acro"/> <s:report test="following-sibling::node()[local-name()="title"]/@lang = @lang"> The "title" language must not be duplicated. </s:report> </element> </oneOrMore> </define> <define name="article.authors">Article authors will be defined by authors' ID's in the body of the element. Remember that their order is important. The same author must not be entered twice. The pattern is used in: <define name="article.authors"> <zeroOrMore> <element name="author"> <data type="NMTOKEN"/> <s:report test="following-sibling::node()[local-name()="author"] = ."> The author tokens must not be duplicated. </s:report> </element> </zeroOrMore> </define> <define name="article.keywords">Similarly the keywords are also given as keyword ID's in the element body but their order is irrelevant. The keywords must not be duplicated. The pattern is used in: <define name="article.keywords"> <zeroOrMore> <element name="keyword"> <data type="NMTOKEN"/> <s:report test="following-sibling::node()[local-name()="keyword"] = ."> The keyword tokens must not be duplicated. </s:report> </element> </zeroOrMore> </define> <define name="article.abstract">Abstracts have similar semantics as The abstract contains usually a few lines of text which are best represented with a plain text
and possibly acronyms. Sometimes it may have a complex structure. In such a case the markup must be
enclosed within one or more The abstract in a particular language must not be duplicated. The pattern is used in: <define name="article.abstract"> <zeroOrMore> <element name="abstract"> <ref name="def.lang.attr"/> <ref name="def.abstract.contents"/> <s:report test="following-sibling::node()[local-name()="abstract"]/@lang = @lang"> The "abstract" language must not be duplicated. </s:report> </element> </zeroOrMore> </define> <define name="def.abstract.contents">As written above, the abstract contents is a simple text or one or more paragraphs. The pattern is used in: <define name="def.abstract.contents"> <choice> <ref name="text.or.acro"/> <ref name="def.paragraphs"/> </choice> </define> <define name="def.paragraphs">
The paragraphs are enclosed in the The pattern is used in: <define name="def.paragraphs"> <oneOrMore> <element name="para"> <ref name="def.para.contents"/> </element> </oneOrMore> </define> <define name="def.para.contents">The paragraphs may contain simple text with acronyms or a few markup elements borrowed from HTML. The pattern is used in: <define name="def.para.contents"> <zeroOrMore> <choice> <ref name="text.or.acro"/> <ref name="def.para.elements"/> </choice> </zeroOrMore> </define> <define name="def.para.elements">The paragraph elements consists of lists and inline elements. The pattern is used in: <define name="def.para.elements"> <choice> <element name="ol"> <ref name="def.list"/> </element> <element name="ul"> <ref name="def.list"/> </element> <ref name="def.inline"/> </choice> </define> <define name="def.list">
The list elements contain one or more The pattern is used in: <define name="def.list"> <zeroOrMore> <element name="li"> <zeroOrMore> <ref name="def.inline"/> </zeroOrMore> </element> </zeroOrMore> </define> <define name="def.inline">
The inline elements are basically font changing commands and, of course, plain text. Element
The pattern is used in: <define name="def.inline"> <choice> <ref name="text.or.acro"/> <element name="b"> <ref name="inline.contents"/> </element> <element name="i"> <ref name="inline.contents"/> </element> <element name="tt"> <ref name="inline.contents"/> </element> <element name="em"> <ref name="inline.contents"/> </element> <element name="quote"> <ref name="inline.contents"/> </element> <element name="cmd"> <ref name="inline.contents"/> </element> </choice> </define> <define name="inline.contents">The inline elements may contain a text with acronyms and other inline elements. The pattern is used in: <define name="inline.contents"> <zeroOrMore> <choice> <ref name="text.or.acro"/> <ref name="def.inline"/> </choice> </zeroOrMore> </define> <define name="def.bibliography">
The main purpose of the list of references is to retrieve information on articles into the
TEX file. It is, however, allowed to store the retrieved information also as an XML
file. The root element must always contain the link to the index file. Its contents is either a list of requested bibliography entries
or retrieved articles (usually with the full information as discussed in the description of the The pattern is used in: <define name="def.bibliography"> <element name="bibliography"> <ref name="def.xhref"/> <optional> <ref name="def.lastmod"/> </optional> <choice> <zeroOrMore> <ref name="def.cite"/> </zeroOrMore> <zeroOrMore> <ref name="def.article"/> </zeroOrMore> </choice> </element> </define> <define name="def.cite">
The The pattern is used in: <define name="def.cite"> <element name="cite"> <ref name="art.id"/> <empty/> </element> </define> <start>Start of the grammar. <start> <choice> <ref name="def.index"/> <ref name="def.acrolist"/> <ref name="def.kwdlist"/> <ref name="def.authlist"/> <ref name="def.toc"/> <ref name="def.volume"/> <ref name="def.issue"/> <ref name="def.bibliography"/> </choice> </start> |