DTD for Modular Vocabulary (mv) files

This software is part of the GLOSS system, http://gloss.bham.ac.uk. Author: Richard Kaye, May 2006, copyright reserved. Licence: This software may be used under the conditions of the latest version of the GPL. No warranty.

Contents

Overview

The GLOSS system takes a text file and transforms it to xml by means of a modular vocabulary (MV) written in xml and somewhat similar to XSL stylesheets. This document describes the main features of modular vocabularies and the DTD (available online at http://gloss.bham.ac.uk/dtd/mv/modularvocab.dtd) for such modular vocabularies. It is meant as a definitive (but not necessarily easy) guide to the way MV files are read and in particular the MV elements you may use in modular vocabularies. Other tools and documentation in the gloss system may help, but are not described here.

Throughout this document we use the prefixes "mv:" for elements in the modular vocabulary namespace, and "xr:" for elements in the xml representation namespace. These prefixes can be altered by setting parameter entities as explained in the appropriate section, but for simplicity they are describes as elements with their default prefixes as if fixed.

A Modular Vocabulary (mv) file consists of a root mv:modularvocab element containing modes defined by mv:mode elements. (There are other top-level elements allowed for initialization of parameters and definition of namespaces, these are also explained below.) When the gloss processor is in a particular mode, it parses its input into tokens and processes these tokens according to the instructions in the mode. The mode therefore contains a mixture of executable instructions (these are the mv:... elements) and other XML data which is placed on an output tree, in a manner similar to XSLT.

Gloss produces output which is an XML description in a simplified XML vocabulary of an output XML document. The relationship between the XML and the output document is defined by elements in the xml representation namespace, with default prefix (as used here) of xr:. See that section of the Gloss documentation for further details.

This documentation is generated from the DTD itself. Sections of DTD occuring here are from the DTD and are definitive, and all of the DTD is presented in this way. The rest is additional description and links for human readers.

XInclude

We provide some support for top-level xi:include elements.

<!ENTITY % xi.prefix "xi">
<!ENTITY % xi.nsattr "xmlns:%xi.prefix;">
<!ENTITY % xi.include "%xi.prefix;:include">
<!ELEMENT %xi.include; EMPTY >
<!ATTLIST %xi.include;
    %xi.nsattr;       CDATA       #FIXED    "http://www.w3.org/2001/XInclude"
    href              CDATA       #IMPLIED
    parse             (xml|text)  "xml"
    xpointer          CDATA       #IMPLIED
    encoding          CDATA       #IMPLIED
    accept            CDATA       #IMPLIED
    accept-language   CDATA       #IMPLIED
>

Parameters and interpolation

At any moment of execution, there is a set of active parameters containing additional data other than the current token being processed and the current mode of execution. These parameters have a name (normally consisting of a URI or prefix followed by a string of letters, underscores, hyphens and digits) and value which is a string of characters. Certain commands manipulate these parameters, as you would expect. Parameter values are used to modify textual data, such as attribute values etc.

Almost every attribute value and text in the mv input files is modified or evaluated using interpolation. This means that prefixes are resolved to their corresponding URI namespaces, parameter references in the text are replaced by the corresponding parameter values, and certain built-in parameters are repaced by their values from the current token or mode. The rules by which this happens are explained in a separate page on parameters.

Processing Text nodes

Text nodes in the MV file are ignored except when executing commands. (The code for execution is in java class gloss.GlossExecution.) When executing text, the following is performed.

First leading and trailing whitespace is removed, and if the result is empty nothing more is done. (See also , mv:cr and mv:literal if you want to add whitespace or other literal text to the output.) The remaining text is interpolated using the standard rules.

If the current output mode is a CharacterData node (Comment, CDATA, Text) then the resulting text is added to that. Otherwise a new Text node is created and the text placed in that.

See also mv:text.

Processing CDATA nodes

CDATA nodes in the MV file are ignored except when executing commands. (The code for execution is in java class gloss.GlossExecution.) CDATA is executed as text, except that the text is not interpolated, whitespace is not stripped, and an empty string is treated like any other.

As for text, if the current output mode is a CharacterData node (Comment, CDATA, Text) then the resulting text is added to that. Otherwise a new CDATA node is created and the text placed in that.

See also mv:cdata.

Processing Comment nodes

The mv source document may contain comments where-ever they are allowed by XML. There is no action or output associated with such comments. See also mv:comment.

Processing Processing-instruction nodes

Processing-instruction nodes in the MV file are ignored except when executing commands. (The code for execution is in java class gloss.GlossExecution.) When executing Processing-instruction nodes, they are copied verbatim to the output document in the current place without any interpolation. See also mv:processing-instruction.

Prefix and namespace for MV

The following lists and describes the parameter entities defined in this DTD, modularvocab.dtd, to do with defining or changing the XML namespace prefix (default mv:) and the namespace for such elements.

%mv.prefix;

<!ENTITY % mv.prefix "mv">

%mv.prefix; defines the prefix used for mv elements. (There are no attributes specific to the mv namespace.) Redefine this to some other prefix that you prefer to use. (Note: you must use some prefix. There is no provision to use the default (i.e., prefix-less) namespace.) The default value is mv.

%mv.namespace;

<!ENTITY % mv.namespace "'http://gloss.bham.ac.uk/xmlns/modularvocab'">

%mv.namespace; defines the namespace URI for mv elements. You probably won't need to modify this.

%mv.nsattr;

<!ENTITY % mv.nsattr "xmlns:%mv.prefix;">

%mv.nsattr; defines the attribute name xmlns:mv defining the mv namespace according to the XML namespaces rules. You probably won't need to modify this either. This attribute may be added to mv:declare-prefix, mv:modularvocab, mv:mode, mv:init-parameter, mv:set-parameter elements.

A list of gloss element name

The following is an alphabetical list of additional parameters that simply define the full qualified name of the element they name. In all cases %mv.XXXX; expands to mv:XXXX (where mv: is the current prefix and XXXX is the local name). These will not need to be changed. Each of these elements is described in detail below, and the code for their execution is in java class gloss.GlossExecution.

abort

<!ENTITY % mv.abort "%mv.prefix;:abort">

append-parameter

<!ENTITY % mv.append-parameter "%mv.prefix;:append-parameter">

attribute

<!ENTITY % mv.attribute "%mv.prefix;:attribute">

cdata

<!ENTITY % mv.cdata "%mv.prefix;:cdata">

character-reference

<!ENTITY % mv.character-reference "%mv.prefix;:character-reference">

comment

<!ENTITY % mv.comment "%mv.prefix;:comment">

cr

<!ENTITY % mv.cr "%mv.prefix;:cr">

declare-prefix

<!ENTITY % mv.declare-prefix "%mv.prefix;:declare-prefix">

default

<!ENTITY % mv.default "%mv.prefix;:default">

document

<!ENTITY % mv.document "%mv.prefix;:document">

document-fragment

<!ENTITY % mv.document-fragment "%mv.prefix;:document-fragment">

doctype

<!ENTITY % mv.doctype "%mv.prefix;:doctype">

dtd

<!ENTITY % mv.dtd "%mv.prefix;:dtd">

element

<!ENTITY % mv.element "%mv.prefix;:element">

element-declaration

<!ENTITY % mv.element-declaration "%mv.prefix;:element-declaration">

else

<!ENTITY % mv.else "%mv.prefix;:else">

entity-reference

<!ENTITY % mv.entity-reference "%mv.prefix;:entity-reference">

error

<!ENTITY % mv.error "%mv.prefix;:error">

execute

<!ENTITY % mv.execute "%mv.prefix;:execute">

export-parameter

<!ENTITY % mv.export-parameter "%mv.prefix;:export-parameter">

get-text

<!ENTITY % mv.get-text "%mv.prefix;:get-text">

hook

<!ENTITY % mv.hook "%mv.prefix;:hook">

if

<!ENTITY % mv.if "%mv.prefix;:if">

if-not

<!ENTITY % mv.if-not "%mv.prefix;:if-not">

include

<!ENTITY % mv.include "%mv.prefix;:include">

incr-parameter

<!ENTITY % mv.incr-parameter "%mv.prefix;:incr-parameter">

init-parameter

<!ENTITY % mv.init-parameter "%mv.prefix;:init-parameter">

infix

<!ENTITY % mv.infix "%mv.prefix;:infix">

literal

<!ENTITY % mv.literal "%mv.prefix;:literal">

match

<!ENTITY % mv.match "%mv.prefix;:match">

message

<!ENTITY % mv.message "%mv.prefix;:message">

mode

<!ENTITY % mv.mode "%mv.prefix;:mode">

modularvocab

<!ENTITY % mv.modularvocab "%mv.prefix;:modularvocab">

processing-instruction

<!ENTITY % mv.processing-instruction "%mv.prefix;:processing-instruction">

process-tokens

<!ENTITY % mv.process-tokens "%mv.prefix;:process-tokens">

return

<!ENTITY % mv.return "%mv.prefix;:return">

set-parameter

<!ENTITY % mv.set-parameter "%mv.prefix;:set-parameter">

group

<!ENTITY % mv.group "%mv.prefix;:group">

text

<!ENTITY % mv.text "%mv.prefix;:text">

xr-element

<!ENTITY % mv.xr-element "%mv.prefix;:xr-element">

Description of individual modular vocabulary elements

%mv.abort;

Synopsis:

<mv:abort/>

The "mv:abort" element pushes the current token back on to the input stream (which may possibly be re-read as a different token depending on the mode it is next read in), and ends the current mode (started with mv:execute or mv:process-tokens or was the main root mode "main") passing control to the previous mode.

<!ELEMENT %mv.abort; EMPTY>

%mv.append-parameter;

Synopsis:

<mv:append-parameter [name="..."] [value="..."] />

This appends data to a parameter value. <mv:append-parameter name="xxx" value="yyy"/> is equivalent to <mv:set-parameter name="xxx" value="${xxx}yyy" /> but is more convenient and may be faster. Both attributes are interpolated as usual first. Default for name is $q and for value is $v.

<!ELEMENT %mv.append-parameter; EMPTY>
<!ATTLIST %mv.append-parameter;
    name CDATA "$q" 
    value CDATA #IMPLIED >

%mv.attribute;

Synopsis:

<mv:attribute [name="..."] [ns="..."]>
    ...
</mv:attribute>

Attributes name and ns are interpolated. Name has default value $q; ns has default value ${{XMLNS}$p}, where XMLNS is a URI mapping gloss parameter values to XML namespace prefixes. (Note that XML does not allow attributes to have a default namespace so $p must be non-null.) The output is an attribute node with namespace given either by the ns value or by ${{XMLNS}$p} and value being the content of the element. It is an error to give the name a prefix if the namespace is undefined. Note that it is the first of a group of attributes with the same name and namespace that are significant.

<!ELEMENT %mv.attribute; ANY >
<!ATTLIST %mv.attribute;
    name CDATA "$q"
    ns CDATA #IMPLIED >

%mv.cdata;

Synopsis:

<mv:cdata>
    ...
</mv:cdata>

Inserts a cdata node into the output tree with the content given.

<!ELEMENT %mv.cdata; ANY >
<!ATTLIST %mv.cdata; xml:space (default|preserve) "preserve" >

%mv.character-reference;

Synopsis:

<mv:character-reference [name="..."]/>

Inserts an xr:character-reference element into the output tree. with reference name (default value $q).

<!ELEMENT %mv.character-reference; EMPTY>
<!ATTLIST %mv.character-reference;
    name CDATA "$q" >

%mv.comment;

Synopsis:

<mv:comment>
      ...
</mv:comment>

Inserts a comment node into the output tree, with textual content that of the node.

<!ELEMENT %mv.comment; ANY >
<!ATTLIST %mv.comment; xml:space (default|preserve) "preserve" >

%mv.cr;

Synopsis:

<mv:cr />

mv:cr elements signify that a carriage return should be placed on the output. TO-DO: need to think about any better way of controlling whitespace in the output.

<!ELEMENT %mv.cr; EMPTY>

%mv.declare-prefix;

Synopsis:

<mv:declare-prefix [xmlns:mv="..."] prefix="..." uri="...">
      ...
</mv:declare-prefix>

Defines a mapping of prefix to uri for a set of modes, or set/init-parameter commands. The content of a mv:declare-prefix command consists of a number of mv:set-parameter mv:init-parameter mv:declare-prefix or mv:modes. Neither attrubute is interpolated.

<!ELEMENT %mv.declare-prefix; (%mv.set-parameter;|%mv.init-parameter;|%mv.declare-prefix;|%mv.mode;|%xi.include;)*>
<!ATTLIST %mv.declare-prefix;     
    %mv.nsattr; CDATA #FIXED %mv.namespace;
    uri CDATA #REQUIRED
    prefix CDATA #REQUIRED >

%mv.default;

Synopsis:

<mv:default
      [children-total="..."]
      [children-remaining="..."]
      [children-adjust="..."]
>
    ...
</mv:default>

These elements are children of mv:mode elements and denote action to take when a token has been accepted but no earlier match has been found. There are no attributes and the allowed content (the "..." above) is exactly as for mv:match.

<!ELEMENT %mv.default; ANY >
<!ATTLIST %mv.default;
    children-total CDATA #IMPLIED
    children-remaining CDATA #IMPLIED
    children-adjust CDATA #IMPLIED > 

%mv.document;

Synopsis:

<mv:document [xmldecl="..."] [version="..."] [encoding="..."] [standalone="..."] >
    ...
</mv:document>

Creates a root xr:document node to contain data, and identifies which XML declaration to use.

<!ELEMENT %mv.document; ANY >
<!ATTLIST %mv.document;    
    xmldecl CDATA #IMPLIED
    version CDATA #IMPLIED 
    encoding CDATA #IMPLIED 
    standalone CDATA #IMPLIED >

%mv.document-fragment;

Synopsis:

<mv:document-fragment [xmldecl="..."] [version="..."] [encoding="..."] >
    ...
</mv:document>

Creates a root xr:document-fragment node to contain data, and identifies which XML encoding declaration to use.

<!ELEMENT %mv.document-fragment; ANY >
<!ATTLIST %mv.document-fragment;
    xmldecl CDATA #IMPLIED
    version CDATA #IMPLIED 
    encoding CDATA #IMPLIED >

%mv.document-fragment;

Synopsis:

<mv:doctype [root="..."] [public="..."] [system="..."] >
    ...
</mv:doctype>

Creates a root xr:doctype node to contain a suitable DOCTYPE declaration. The root attribute is optional and will be inferred from other data if necessary. Content may be an internal DTD. (DTDs are TO DO.)

<!ELEMENT %mv.doctype; ANY >
<!ATTLIST %mv.doctype;
    root CDATA #IMPLIED
    public CDATA #IMPLIED 
    system CDATA #IMPLIED >

%mv.dtd;

Synopsis:

<mv:dtd [xmldecl="..."] [version="..."] [encoding="..."]>
    ...
</mv:dtd>

Creates a DTD document. Everything to do with DTDs and their content is TO DO.

<!ELEMENT %mv.dtd; ANY >
<!ATTLIST %mv.dtd;    
    xmldecl CDATA #IMPLIED
    version CDATA #IMPLIED 
    encoding CDATA #IMPLIED >

%mv.element;

Synopsis:

<mv:element [name="..."] [ns="..."] >
      ...
</mv:element>

The "mv:element" command starts a new element node with the name and namespace given. If the name is "prefix:local" and the attribute ns is not given explicitly, the namespace is obtained from a parameter value. It is an error to give the name a prefix if the namespace is undefined.

The content of this node defines the content of the element.

<!ELEMENT %mv.element; ANY >
<!ATTLIST %mv.element;
    name CDATA "$q"
    ns CDATA #IMPLIED >

%mv.element-declaration;

Synopsis:

<mv:element-declaration name="..." [content="..."] >
      ...
</mv:element-declaration>

Part of the DTD description which is still TO DO.

<!ELEMENT %mv.element-declaration; ANY >
<!ATTLIST %mv.element-declaration;
    name CDATA #REQUIRED
    content CDATA #IMPLIED >

%mv.else;

Synopsis:

<mv:else>
      ...
</mv:else>

If immediately following <mv:if ...></mv:if> or <mv:if-not ...></mv:if-not> the content is executed if the test in <mv:if ...> (or <mv:if-not ...>) is false (true, respectively). Otherwise the content is ignored.

<!ELEMENT %mv.else; ANY >

%mv.entity-reference;

Synopsis:

<mv:entity-reference [name="..."]/>

Inserts an xr:entity-reference element into the output tree.

<!ELEMENT %mv.entity-reference; EMPTY>
<!ATTLIST %mv.entity-reference;
    name CDATA "$q" >

%mv.error;

Synopsis:

<mv:error>PCDATA</mv:error>

The content of the error command is text that is interpolated in the usual way. It becomes the message of a parse exception that is thrown immediately, usually stopping the computation.

<!ELEMENT %mv.error; (#PCDATA)>

%mv.execute;

Synopsis:

<mv:execute
      mode="..."
      [data="..."]
      [type="..."]
      [parameters="[no]share"]
      [hook=...]
/>

The execute command executes the named mode as if a token of the given type (with data as given, and depth, linenumber, columnnumber taken from the current token) had been read. It finds the appropriate match and performs the content of this match element and then returns to the calling mode. It is an error if there is no mode with the given name. The attribute parameters="[no]share" behaves as for mv:process-tokens and has default value "noshare".

<!ELEMENT %mv.execute; (%mv.set-parameter;|%mv.init-parameter;|
                        %mv.incr-parameter;|%mv.append-parameter;)*>
<!ATTLIST %mv.execute;
    mode CDATA #REQUIRED
    type CDATA "$t"
    data CDATA "$d"
    hook (none|preprocess|process|postprocess|execute) #IMPLIED
    parameters (share|noshare) "noshare" >   

%mv.export-parameter;

Synopsis:

<mv:export-parameter name="..." [value="..."]/>

This sets the value of the parameter to the value given, if present, and then exports the parameter's value to the first ancestor node with the same prefix.

<!ELEMENT %mv.export-parameter; EMPTY>
<!ATTLIST %mv.export-parameter;
    name CDATA #REQUIRED
    value CDATA #IMPLIED >

%mv.get-text;

Synopsis:

<mv:get-text [name="..."] />

The last node placed is removed and its text value is stored in the parameter with the given name.

<!ELEMENT %mv.get-text; EMPTY >
<!ATTLIST %mv.get-text;
    name CDATA #IMPLIED >

%mv.hook;

Synopsis:

<mv:hook action="..." mode="..." />
<!ELEMENT %mv.hook; EMPTY >
<!ATTLIST %mv.hook;
    action (preprocess|process|postprocess|execute) #REQUIRED
    mode CDATA #REQUIRED >

%mv.if;

Synopsis:

<mv:if [test="..."] [value="..."] >
      ...
</mv:if>

Here, the expression at "test" is evaluated using usual rules. If value="..." is omitted the test is true iff this expression is non-null and non-empty. Otherwise the test is true if the expression evaluates to the same one that value does. If the test comes out true, then the children of the node are executed. name and value are interpolated as usual.

<!ELEMENT %mv.if; ANY >
<!ATTLIST %mv.if;
    test CDATA #IMPLIED 
    value CDATA #IMPLIED >

%mv.if-not;

Synopsis:

<mv:if-not [test="..."] [value="..."] >
      ...
</mv:if-not>

Here, the expression at "test" is evaluated using usual rules. If value="..." is omitted the test is true iff this expression is null or empty. Otherwise the test is true if the expression evaluates to the a different one that value does. If the test comes out true, then the children of the node are executed. name and value are interpolated as usual.

<!ELEMENT %mv.if-not; ANY >
<!ATTLIST %mv.if-not;
    test CDATA #IMPLIED 
    value CDATA #IMPLIED >

%mv.include;

Synopsis:

<mv:include mode="..." hook="..." />

"mv:include" tags signify that the matches from one mode should be considered as included at that point in another. They do not affect the "accept" or other attributes of the parent mv:mode element.

<!ELEMENT %mv.include; EMPTY>
<!ATTLIST %mv.include;
    mode CDATA #REQUIRED 
    hook (none|preprocess|process|postprocess|execute) #IMPLIED >

%mv.incr-parameter;

Synopsis:

<mv:incr-parameter [name="..."] [value="..."] />

This numerically adds data to an existing parameter value. <mv:incr-parameter name="xxx" value="yyy"/> is equivalent to xxx=xxx+yyy except when xxx does not resolve to an integer then xxx is left unchanged. value="1" is the default.

<!ELEMENT %mv.incr-parameter; EMPTY>
<!ATTLIST %mv.incr-parameter;
    name CDATA "$q" 
    value CDATA "1" >

%mv.init-parameter;

Synopsis:

<mv:init-parameter [name="..."] [value="..."] />

The result of this command is that the parameter specified by "name" is initialized to value specified by "value", unless it has already been set or initialized, in which case no changes are made.

<!ELEMENT %mv.init-parameter; EMPTY>
<!ATTLIST %mv.init-parameter;
    %mv.nsattr; CDATA #FIXED %mv.namespace;
    name CDATA "$q" 
    value CDATA #IMPLIED >

%mv.infix;

Synopsis:

<mv:infix [name="..."] [ns="..."] >
      ...
</mv:infix>

The "mv:infix" command starts a new element node with the name and namespace given. This node replaces the last node put onto the output tree at the current position, and this replaced node becomes the first child of the new element. It is an error if there is no such node to replace.

In other respects, it behaves just like mv:element So if the name is "prefix:local" and the attribute ns is not given explicitly, the namespace is obtained from a parameter value. It is an error to give the name a prefix if the namespace is undefined.

The content of this node defines additional content of the element.

Attributes to this element may be added using <mv:attribute> or <xr:attribute>. The fact that the element already has children will not affect this.

<!ELEMENT %mv.infix; ANY >
<!ATTLIST %mv.infix;
    name CDATA "$q"
    ns CDATA #IMPLIED >

%mv.literal;

Synopsis:

<mv:literal>...</mv:literal>

The contents of the element (usually a CDATA block) are put on the output in literal fashion.

<!ELEMENT %mv.literal; ANY >
<!ATTLIST %mv.literal; xml:space (default|preserve) "preserve" >

%mv.match;

Synopsis:

<mv:match
      type="..."
      [data="..."]
      [prefix="..."]
      [localname="..."]
      [fullname="..."]
      [value="..."]
      [children-total="..."]
      [children-remaining="..."]
      [children-adjust="..."]
>...</mv:match>

"mv:match" tags signify possible matches in a mode against a new token. The type must be given and must match. The other data should match if given.

The data, localname, prefix, fullname, value attributes specify data that must match. All of the attributes from this list that are presented must match for a match to have deemed to occur. Simple matches just specify the string that these datamust equal. (Such strings must not start with a $ character). A more complex matching syntax exists when one of these attributes is given and starts with a $.

The children-XXX attributes change the expected number of children tokens of the mode this <mv:match> is being interpreted in. You can make absolute changes to the total (children-total) or to the number of remaining children (children-remainaing), or relative changes to either (children-adjust). If more than one of these three attributes is given, total takes precidence over remaining which takes precedence over adjust.

<!ELEMENT %mv.match; ANY >
<!ATTLIST %mv.match;
    type CDATA #REQUIRED
    data CDATA #IMPLIED
    localname CDATA #IMPLIED
    prefix CDATA #IMPLIED
    fullname CDATA #IMPLIED
    value CDATA #IMPLIED 
    children-total CDATA #IMPLIED
    children-remaining CDATA #IMPLIED
    children-adjust CDATA #IMPLIED > 

%mv.message;

Synopsis:

<mv:message>PCDATA</mv:message>

A message is printed to standard error on the console, perhaps indicating a possible problem. The content of the element is text which is interpolated in the usual way and printed as the message.

<!ELEMENT %mv.message; (#PCDATA)>

%mv.mode;

Synopsis:

<mv:mode name="..." [accept="..."] [use-indentation="..."] [children="..."] [template="..."]>
      <mv:match ...>...</mv:match>
      <mv:match ...>...</mv:match>
      ...
      <mv:include .../>
      ...
      <mv:default>...</mv:default>
</mv:mode>

An mv:mode is a mode of operation or module for this vocabulary, and consists of a list of possible matches for tokens.

The "accept" attribute lists all possible types of token that will be allowed together with all possible allowed punctuation symbols. The default for "main" is "accept=''"; therwise there is no default and "accept" must be given.

The possible types for accept, other than literal punctuation, are

     attr|b64|char|cref|elt|eref|eos|fp|hex|int|label|
     pdef|pelt|pref|pi|punc|str|ns|uc|uri

Attribute "children" (default = +infinity, except when name="main" when children="1" is the default) allows the user to specify a maximum number of tokens received by this mode.

Setting "use-indentation='false'" stops the default mechanism that exits a mode when a lower-or-same indented token is found amongst sub-tokens of a node. The default value for use-indentation is normally true (except when name="main" when it is false) but this default can be reset by changing the %mv.use-indentation-default; parameter.

NONE of the attributes here are interpolated.

<!ELEMENT %mv.mode; (%mv.match;|%mv.default;|%mv.include;)*>
<!ATTLIST %mv.mode;
    %mv.nsattr; CDATA #FIXED %mv.namespace;
    name CDATA #REQUIRED
    type (execute|process|include) #IMPLIED
    private (private|noprivate) "noprivate"
    final (final|nofinal) "nofinal"
    accept CDATA #IMPLIED
    children CDATA #IMPLIED
    template CDATA #IMPLIED
    use-indentation CDATA #IMPLIED >

%mv.modularvocab;

Synopsis:

<mv:modularvocab>
      ...
</mv:modularvocab>

"mv:modularvocab" is the root element and its content consists of a number of mv:set-parameter mv:init-parameter mv:declare-prefix or mv:modes.

<!ELEMENT %mv.modularvocab; (%mv.set-parameter;|%mv.init-parameter;|%mv.declare-prefix;|%mv.mode;|%xi.include;)*>
<!ATTLIST %mv.modularvocab; 
    %mv.nsattr; CDATA #FIXED %mv.namespace; >

%mv.processing-instruction;

Synopsis:

<mv:processing-instruction [target="..."]>
      ...
</mv:processing-instruction>

Inserts a processing instruction node into the output tree, with target as given and textual content that of the node.

<!ELEMENT %mv.processing-instruction; ANY >
<!ATTLIST %mv.processing-instruction;
    target CDATA "$q" >

%mv.process-tokens;

Synopsis:

<mv:process-tokens 
      [mode="..."] 
      [use-indentation="..."] 
      [children="..."] 
      [hook=...]
      [parameters="[no]share"]
/>

The "mv:process-tokens" command pushes to start a new mode (as named, or if this name is not given, with the same name as the current node). The new mode name is interpolated in the usual way.

Unless parameters="share" is present, "mv:process-tokens" uses a different clone of the parameter list so any set-parameter executed within the process-tokens will not affect the current parameter list. (N.B., subsequent "mv:process-tokens" commands will also need parameters="share" to export their parameters, i.e., parameter changes made after a subsequently executed "mv:process-tokens" without parameters="share" will not be exported.) See also export-parameter.

The "children" and "use-indentation" attributes can be used here to override any declared in the mode.

<!ELEMENT %mv.process-tokens; (%mv.set-parameter;|%mv.init-parameter;|
                               %mv.incr-parameter;|%mv.append-parameter;)* >
<!ATTLIST %mv.process-tokens;
    mode CDATA "$m"
    children CDATA #IMPLIED
    use-indentation (true|false) #IMPLIED
    hook (none|preprocess|process|postprocess|execute) #IMPLIED
    parameters (share|noshare) "noshare" >   

%mv.return;

Synopsis:

<mv:return />

<mv:return/> ends the current mode passing control to the previous mode.

<!ELEMENT %mv.return; EMPTY>

%mv.set-parameter;

Synopsis:

<mv:set-parameter [name="..."] [value="..."] />

The result of this command is that the parameter specified by "name" is set to value specified by "value". Both name and value are interpolated as usual. Parameters can be used in text modes, many attributes, and to define namespaces.

<!ELEMENT %mv.set-parameter; EMPTY>
<!ATTLIST %mv.set-parameter;
    %mv.nsattr; CDATA #FIXED %mv.namespace;
    name CDATA "$q" 
    value CDATA #IMPLIED >

%mv.group;

Synopsis:

<mv:group>
    ...
</mv:group>

This generates an xr:group element for adding additional grouping structure to the output.

<!ELEMENT %mv.group; ANY >

%mv.text;

Synopsis:

<mv:text>
      ...
</mv:text>

Inserts a text node into the output tree, with textual content that of the node. Note that this element is converted to a genuine text node, not an intermediate xr:text representation.

<!ELEMENT %mv.text; ANY >
<!ATTLIST %mv.text; xml:space (default|preserve) "preserve" >

%mv.xr-element;

Synopsis:

<mv:xr-element name="NAME">
      ...
</mv:xr-element>

Inserts an element in the XR namespace directly into the output tree. This element will be processed by the printer.

<!ELEMENT %mv.xr-element; ANY >
<!ATTLIST %mv.xr-element; name CDATA #REQUIRED >

Elements representing tokens

We read in here the DTD for gloss tokens. This is useful for mvs that receive an unexpected tokens and don't know what to do with it, or for post-processing using XSLT. This DTD for gloss tokens is very straightforward. You should find it described elsewhere.

<!ENTITY % tokens.dtd SYSTEM "http://gloss.bham.ac.uk/dtd/tok/tokens.dtd" >
%tokens.dtd;

See the documentation elsewhere for this DTD.

This page is copyright. Web page design and creation by GLOSS.