Tag library name: cast-taglib


Index of Tags and Functions.
Tags
  1. tomatrix.
  2. tomultpoly.
  3. toset.
  4. tounivpoly.
Functions
  1. toMatrix.
  2. toMultPoly.
  3. toSet.
  4. toUnivPoly.



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



Description:

This tag library allows to "cast" OpenMath objects. By cast we mean transform an OpenMath object into an OpenMath object of other kind. Of course, if there is acceptable way to do this conversion (e.g. list of lists to matrices, sets to lists, etc).




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
om-lib.jardownloadROML library
cast-taglib.jardownloadThe tag library jar file.

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 cast-taglib.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/cast-taglib.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:

None




Tags


1-tomatrix (tag).
Description

Tries to cast OpenMath object into a Matrix.

Body Content:

JSP

Tag Class:

nl.tue.win.riaca.taglib.cast.ToMatrixTag



Attributes:
NameRequiredDynamicDescription
scopefalsefalse The scope were var is instantiated. The default value for scope is "page".
valuefalsetrue The value to be assigned. That is other ROML object to be assigned to the variable specified by var or a string containing the XML encoding of the OpenMath object.
varfalsefalse The name of the variable you want to place in the scope.


Examples:
Snippet 1:
        
        <cast:tomatrix var="Matrix1">
            <OMOBJ>
                <OMA>

                    <OMS cd="list1" name="list"/>
                    <OMA>
                        <OMS cd="list1" name="list"/>
                        <OMI>123</OMI>
                        <OMI>15</OMI>

                    </OMA>
                    <OMA>
                        <OMS cd="list1" name="list"/>
                        <OMI>-12</OMI>
                        <OMI>151</OMI>

                    </OMA>
                </OMA>
            </OMOBJ>
        </cast:tomatrix>
        




2-tomultpoly (tag).
Description

Tries to cast OpenMath object into a Multivariate Polynomial.

Body Content:

JSP

Tag Class:

nl.tue.win.riaca.taglib.cast.ToMultPolyTag



Attributes:
NameRequiredDynamicDescription
scopefalsefalse The scope were var is instantiated. The default value for scope is "page".
valuefalsetrue The value to be assigned. That is other ROML object to be assigned to the variable specified by var or a string containing the XML encoding of the OpenMath object.
varfalsefalse The name of the variable you want to place in the scope.


Examples:
Snippet 1:
        
        <cast:tomultpoly var="poly1">
            <OMOBJ>
                <OMA>
                    <OMS cd="arith1" name="plus"/>

                    <OMA>
                        <OMS cd="arith1" name="times"/>
                        <OMI>123</OMI>
                        <OMV name="X"/>
                        <OMV name="Y"/>

                    </OMA>
                    <OMA>
                        <OMS cd="arith1" name="times"/>
                        <OMI>5</OMI>
                        <OMV name="X"/>

                        <OMV name="Y"/>
                        <OMV name="Z"/>
                    </OMA>
                    <OMI>-12</OMI>
                </OMA>

            </OMOBJ>
        </cast:tomultpoly>
        




3-toset (tag).
Description

Tries to cast OpenMath object into a Set.

Body Content:

JSP

Tag Class:

nl.tue.win.riaca.taglib.cast.ToSetTag



Attributes:
NameRequiredDynamicDescription
scopefalsefalse The scope were var is instantiated. The default value for scope is "page".
valuefalsetrue The value to be assigned. That is other ROML object to be assigned to the variable specified by var or a string containing the XML encoding of the OpenMath object.
varfalsefalse The name of the variable you want to place in the scope.


Examples:
Snippet 1:

        
        <cast:tomatrix var="Set1">
            <OMOBJ>
                <OMA>
                    <OMS cd="list1" name="list"/>
                    <OMA>
                        <OMS cd="list1" name="list"/>

                        <OMI>123</OMI>
                        <OMI>15</OMI>
                    </OMA>
                    <OMA>
                        <OMS cd="list1" name="list"/>

                        <OMI>-12</OMI>
                        <OMI>151</OMI>
                    </OMA>
                </OMA>
            </OMOBJ>

        </cast:tomatrix>
        




4-tounivpoly (tag).
Description

Tries to cast OpenMath object into a Univariate Polynomial.

Body Content:

JSP

Tag Class:

nl.tue.win.riaca.taglib.cast.ToUnivPolyTag



Attributes:
NameRequiredDynamicDescription
scopefalsefalse The scope were var is instantiated. The default value for scope is "page".
valuefalsetrue The value to be assigned. That is other ROML object to be assigned to the variable specified by var or a string containing the XML encoding of the OpenMath object.
varfalsefalse The name of the variable you want to place in the scope.


Examples:
Snippet 1:
        
        <cast:tounivpoly var="Poly1">

            <OMOBJ>
                <OMA>
                    <OMS cd="arith1" name="plus"/>
                    <OMA>
                        <OMS cd="arith1" name="times"/>
                        <OMI>123</OMI>

                        <OMV name="X"/>
                    </OMA>
                    <OMA>
                        <OMS cd="arith1" name="times"/>
                        <OMI>5</OMI>

                        <OMV name="X"/>
                    </OMA>
                    <OMI>-12</OMI>
                </OMA>
            </OMOBJ>

        </cast:tounivpoly>
        




Functions


1- toMatrix (function).
Description:

Tries to cast OpenMath object into a Matrix.

Function Class:

nl.tue.win.riaca.taglib.cast.CastFunctions

Function Signature:

java.lang.String toMatrix( java.lang.Object )



Examples:
Snippet 1:

        
            <p>
                <toMathML>
                    ${parse:toMatrix(a)}
                </toMathML>
            </p>
        





2- toMultPoly (function).
Description:

Tries to cast OpenMath object into a Multivariate Polynomial.

Function Class:

nl.tue.win.riaca.taglib.cast.CastFunctions

Function Signature:

java.lang.String toMultPoly( java.lang.Object )



Examples:
Snippet 1:
        
            <p>
                <toMathML>
                    ${parse:toMultPoly(a)}
                </toMathML>
            </p>

        





3- toSet (function).
Description:

Tries to cast OpenMath object into a Set.

Function Class:

nl.tue.win.riaca.taglib.cast.CastFunctions

Function Signature:

java.lang.String toSet( java.lang.Object )



Examples:
Snippet 1:
        
            <p>
                <toMathML>
                    ${parse:toSet(a)}
                </toMathML>

            </p>
        





4- toUnivPoly (function).
Description:

Tries to cast OpenMath object into a Multivariate Polynomial.

Function Class:

nl.tue.win.riaca.taglib.cast.CastFunctions

Function Signature:

java.lang.String toUnivPoly( java.lang.Object )



Examples:
Snippet 1:
        
            <p>
                <toMathML>

                    ${parse:toUnivPoly(a)}
                </toMathML>
            </p>