Tag library name: mathml


Index of Tags and Functions.
Tags
  1. addcd.
  2. phrasebook.
  3. removecd.
  4. tomathml.



Authors:
NameInstitutione-mailRole
E. Reinaldo Barreiro Technical University of Eindhoven (TU/e) info@mathdox.org Main author



Description:

A tab library for working with MathMl phrasebooks.




Download and Install:

Download:

The whole tag library project is available for dowloading, as tar.gz or as a zip file, here .

General INSTALL information:

This tag library is designed to be used in JSP pages compliant with the JSP 2.0 specification.

To get this tag library working you will have to copy the jar files

Jar fileDownloadDescription
mathml-taglib.jardownloadMathML tag library jar file
mathml-phrasebook.jardownloadMathML Phrasebook.
om-lib.jardownloadOpenMath library.

to the WEB-INF/lib/ directory on your web application.

NOTE: We advise you to use the versions of additional jar files comming with the tag library and not to download them directly from other of our related projects. By doing so, you may create imcompatibilities: though we will do our best to make sure a tag library is using the latest version of a jar file.

You will also need to copy the tld file mathml.tld to somewhere in the WEB-INF/ directory, for instance to WEB-INF/ itselft, and add to the web.xml file, in the part corresponding to the tag libraries, the following lines:

<taglib>
    <taglib-uri>URI identifying your tag lib</taglib-uri>

    <taglib-location>/WEB-INF/mathml.tld</taglib-location>
</taglib>
                            

For more information on how to modify the web.xml file peruse the documentation coming with your WEB server/container. For information on how to use tag extensions on your own JSP pages consult the JSP 2.0 specification.

Tag specific INSTALL information:

Note 1: Mind that in the download section we provide links to the jar files for MathML phrasebooks. Theis files can be also downloaded from RIACAs pages concerning phrasebooks. We recommend you to use our tag library with the jar file we provide here as we cannot garantie that our taglib will be compatible with newer versions of RIACAs MathML phrasebook though we will do our best to keep them "synchronized". The same holds for om-lib.jar file.

Note 2: The use of ROML require to have in your classpath a SAX compliant XML parser. Please, refer to ROML's documentation for the details.




Tags


1-addcd (tag).
Description

This tag adds a CD (content dictionary) to an existing Phrasebook. Before using this tag, use the phrasebook tag to create an object of type Phrasebook.

Body Content:

EMPTY

Tag Class:

nl.tue.win.riaca.taglib.mathml.AddCdTag



Attributes:
NameRequiredDynamicDescription
cdtruetrue The name of the CD you want to add.
classtruetrue The full class name of the Java class implementing the CD you want to add.
urlfalsetrue The url of the class implementing the CD you want to add.
valuetruetrue The phrasebook object.


Examples:
Snippet 1:

        
            <!-- We create a MathML phrasebook and place it in the
session scope--> <phrasebook var="MathMLPhrasebook"/> . . . <addcd value="${MathMLPhrasebook}" cd="prog1" url="" javaclass="nl.tue.win.riaca.programming.prog1Codec"/>




2-phrasebook (tag).
Description

This tag allows to create a MathML Phrasebook object and add it to the session scope. By default the new phrasebook object is a bare phrasebook. That means only the core CDs and the basic OpenMath objects are known to the phrasebook. If you want to add additional CDs you can use the addcd tag. You can also remove CDs on the fly with the removecd tag.

Body Content:

JSP

Tag Class:

nl.tue.win.riaca.taglib.mathml.PhrasebookTag



Attributes:
NameRequiredDynamicDescription
newinstancefalsetrue This is a boolean attribute that allows you to restart the whole phrasebook machinery. That is, if the value is true then a new phrasebook object is created and bound to the given name in the session scope. That means if there was an object associated to that name, was it a phrasebook or not, it is then replaced by the newly created phrasebook object.
vartruetrue The name of the phrasebook object to be placed in the session scope.


Examples:
Snippet 1:
        
            <!-- We create a MathML phrasebook and place it in the
session scope--> <phrasebook var="MathMLPhrasebook"/>
Snippet 2:
        
            <!-- We create a MathML phrasebook and place it in the session scope.
                 A new instance is created -->
            <phrasebook var="MathMLPhrasebook" newinstance="true"/>
        




3-removecd (tag).
Description

This tag can be used to remove a CD from an existing phrasebook. So, this tag presupposes you have used the phrasebook tag to create an object of type phrasebook.

Body Content:

EMPTY

Tag Class:

nl.tue.win.riaca.taglib.mathml.RemoveCdTag



Attributes:
NameRequiredDynamicDescription
cdtruetrue The name of the CD you want to remove.
valuetruetrue The phrasebook object.


Examples:
Snippet 1:

        
            <!-- We create a MathML phrasebook and place it in the
session scope--> <phrasebook var="MathMLPhrasebook"/> . . . <addcd value="${MathMLPhrasebook}" cd="prog1" url="" javaclass="nl.tue.win.riaca.programming.prog1Codec"/> . <!-- do something with the prog1 CD and remove it later on--> . <removecd value="${MathMLPhrasebook}" cd="prog1"/>




4-tomathml (tag).
Description

This tag allows to transform an OpenMath object to MathML. It presupposes you have used the phrasebook tag to create an object of type phrasebook.

Body Content:

JSP

Tag Class:

nl.tue.win.riaca.taglib.mathml.ToMathMLTag



Attributes:
NameRequiredDynamicDescription
totransformfalsetrue A string containing the object to treansform (is not present the body of the tag is usde to pass the object).
valuetruetrue The phrasebook object to use for the tranformation.
varfalsefalse A variable were the result is store (as a String).


Examples:
Snippet 1:
        
            <!-- We create a MathML phrasebook and place it in the
session scope--> <phrasebook var="MathMLPhrasebook"/> . . . <tomathml var="result" value="${MathMLPhrasebook}"> <OMOBJ> <OMA> <OMS name="plus" cd="arith1"/> <OMI>${param.A}</OMI> <OMI>${param.B}</OMI> </OMA> </OMOBJ> </tomathml> <p> The number ${result} is... </p>