Generated: May 24, 2003, 13:22:42Copyright ©2003, Kurt NørmarkThe local LAML software home page

Reference Manual of the XML-in-LAML Mirror Generation Tool

Kurt Nørmark ©    normark@cs.auc.dk    Department of Computer Science    Aalborg University    Denmark    

Source file: tools/xml-in-laml/xml-in-laml.scm
LAML Version 20.00 (May 24, 2003, full)

This is the LAML tool that generates the language specific part of an XML mirror in Scheme. From version 20 of LAML, this tool is able to generate a fully validating mirror i Scheme of an XML language from a parsed XML DTD.

Briefly stated, this tool generates deterministic final state automata from the parsed content models, as delivered by the LAML XML DTD parser. These automata are embedded in the validation predicates which accompany the mirror functions in Scheme of the XML elements.

The generated mirrors rely heavily on the common part, which is shared for all XML-in-LAML languages. The common part is found in lib/xml-in-laml/xml-in-laml.scm, and a XML-in-LAML common library manual is available.

Let us denote the language by the symbol L. As input this tool takes a parsed DTD, L.dtd, in the Lisp representation made by the LAML DTD parser. As output the took makes a file L-mirror.scm in the mirror-target-dir.

The tool is typically driven by a LAML script (such as the script for generation of a SVG mirror ) which loads this file.

The main procedure is generate-mirror. As such, this tool can be identified with the generate-mirror procedure.

Please consult "XML mirror in Scheme: XML in LAML" (section 3) for a tutorial introduction to the use of the tool.

Table of Contents:
1. Tool parameters - configuration constants.2. Default language properties.3. The main tool procedure.

Alphabetic index:
action-elementsaction-elementsThe list of action elements (a list of symbols).
auto-lib-loadingauto-lib-loadingIs lib/xml-in-laml/xml-in-laml.scm loaded by the language specific mirror library?
default-document-type-declarationdefault-document-type-declarationThe default value of document-type-declaration.
default-pass-default-dtd-attributes?default-pass-default-dtd-attributes?Controls whether to explicitly pass the default dtd attributes in every instance of it.
default-xml-accept-only-string-valued-attributes?default-xml-accept-only-string-valued-attributes?Controls if only string valued attributes are accepted.
default-xml-char-transformation-tabledefault-xml-char-transformation-tableThe default value of xml-char-transformation-table.
default-xml-non-transliteration-elementsdefault-xml-non-transliteration-elementsThe list of elements names (strings) for which the transliteration does not apply.
default-xml-preformatted-text-elementsdefault-xml-preformatted-text-elementsThe list of elements names (strings) for which all white space content characters must be rendered.
default-xml-represent-white-spacedefault-xml-represent-white-spaceControls the presence of white space markers in the ast.
default-xml-transliterate-character-data?default-xml-transliterate-character-data?A boolean value which controls the default value of CDATA transliteration via the HTML/XML charater transformation table.
generate-mirror(generate-mirror parsed-dtd-path mirror-destination-path language-name)The main tool procedure which makes the mirror of XML in LAML.
make-xml-mirror-function(make-xml-mirror-function element attribute language-name)Construct and return a mirror function.
make-xml-validation-procedure(make-xml-validation-procedure element attribute language-name)Make and return a validation procedure.
mirror-namemirror-nameThe name of the generated mirror - a string without initial path and without extension.
mirror-target-dirmirror-target-dirThe full path of the directory in which to put the mirror.
parsed-dtd-pathparsed-dtd-pathThe full path to the parsed DTD file (a lsp file).
reserved-scheme-namesreserved-scheme-namesScheme names - a list of symbols.

 

1.   TOOL PARAMETERS - CONFIGURATION CONSTANTS.
Please notice that most of these constants must be passed as parameters to the procedure generate-mirror.


mirror-name


Form
mirror-name

Description
The name of the generated mirror - a string without initial path and without extension. Must be defined in the LAML script which parameterizes this tool.


parsed-dtd-path


Form
parsed-dtd-path

Description
The full path to the parsed DTD file (a lsp file). Must be defined in the LAML script which parameterizes this tool


mirror-target-dir


Form
mirror-target-dir

Description
The full path of the directory in which to put the mirror. Must be defined in the LAML script which parameterizes this tool


auto-lib-loading


Form
auto-lib-loading

Description
Is lib/xml-in-laml/xml-in-laml.scm loaded by the language specific mirror library?


action-elements


Form
action-elements

Description
The list of action elements (a list of symbols). The named mirror functions of action elements do not return an AST. The mirror function accessed throught the language map do, however, always return ASTs. Rather, they apply a procedure on the ast. If the element name is N, the action procedure name is N!


reserved-scheme-names


Form
reserved-scheme-names

Description
Scheme names - a list of symbols. Think of these as reserved names in Scheme, which we do not want to redefine as mirror functions.


 

2.   DEFAULT LANGUAGE PROPERTIES.
The default language properties are string-valued variables, which are intended to be set for each new mirror. The value of these variable are inserted into the generated mirror. This explains why all values must be strings. This may seem a little strange, but take a look in the beginning of one of the generated mirror files to see the effect.

Notice that lib/xml-in-laml/xml-in-laml.scm contains a number of configuration options too, together with a number of functions that access/mutate the properties given below. You should only set those that provide inappropriate defaults. It means that you typically only have to set of few of the variables in this section when you make a new mirror.


default-xml-transliterate-character-data?


Form
default-xml-transliterate-character-data?

Description
A boolean value which controls the default value of CDATA transliteration via the HTML/XML charater transformation table. The default value is true. The boolean value must be embedded in a string. This value can be changed after the mirror is generated.


default-xml-non-transliteration-elements


Form
default-xml-non-transliteration-elements

Description
The list of elements names (strings) for which the transliteration does not apply. The list value must be embedded in a string. The value of this variable is locked at mirror generation time.


default-xml-preformatted-text-elements


Form
default-xml-preformatted-text-elements

Description
The list of elements names (strings) for which all white space content characters must be rendered. Typically the HTML pre element. The list value must be embedded in a string. The value of this variable is locked at mirror generation time.


default-xml-char-transformation-table


Form
default-xml-char-transformation-table

Description
The default value of xml-char-transformation-table. The default value is is "html-char-transformation-table". The value must be a string.


default-pass-default-dtd-attributes?


Form
default-pass-default-dtd-attributes?

Description
Controls whether to explicitly pass the default dtd attributes in every instance of it. Normally #f, which is the default value. If #t, it will most likely collide with the attribute validation (only one instance of each attribute name is allowed). The boolean value must be embedded a string. The value of this variable is locked at mirror generation time.


default-xml-accept-only-string-valued-attributes?


Form
default-xml-accept-only-string-valued-attributes?

Description
Controls if only string valued attributes are accepted. The default value is true. The boolean value must be embedded in a string.


default-document-type-declaration


Form
default-document-type-declaration

Description
The default value of document-type-declaration. The value must be a string. The default default is the empty string with the meaning 'no attribute type declaration'. The value of this variable is locked at mirror generation time.


default-xml-represent-white-space


Form
default-xml-represent-white-space

Description
Controls the presence of white space markers in the ast. The default value is true. The boolean value must be a string.


 

3.   THE MAIN TOOL PROCEDURE.
The main tool procedure is generate-mirror. After setting the parameters call this procedure which will make the XML mirror.


generate-mirror


Form
(generate-mirror parsed-dtd-path mirror-destination-path language-name)

Description
The main tool procedure which makes the mirror of XML in LAML. The procedure writes a text file in mirror-destination-path.

Parameters
parsed-dtd-paththe full path to the parsed dtd (a lsp file).
mirror-destination-pathfull path to the file on which to write the mirror.
language-namethe name of language which we mirror in LAML (a symbol).


make-xml-mirror-function


Form
(make-xml-mirror-function element attribute language-name)

Description
Construct and return a mirror function.

Parameters
elementThe parsed element structure, as produced by the LAML DTD parser.
attributeThe parsed attribute structure, as produced by the LAML DTD parser.
language-nameThe name of the XML language, to which this mirror function belongs.


make-xml-validation-procedure


Form
(make-xml-validation-procedure element attribute language-name)

Description
Make and return a validation procedure.

Parameters
elementThe parsed element structure, as produced by the LAML DTD parser.
attributeThe parsed attribute structure, as produced by the LAML DTD parser.
language-nameThe name of the XML language, to which this mirror function belongs.


Generated: May 24, 2003, 13:22:42
This documentation has been extracted automatically from the Scheme source file by means of the Schemedoc tool