morphis logo morphis | wax   
wax manual
wax manual
 

Overview

Architecture

Structure
   Documents
   Navigation
   Forms
   Animation

Devices
   device.xml

DIS
   wax syntax
   text selection
   image selection
   text and image xml

Application
   Configuration
   Servlet
   Filters

DIS Text Selection

WAX DIS for text offers developers even greater flexibility and power for text formatting and selection via parameterized text tags. This capability expands upon the mapping of real text to a logical id as explained in WAX syntax to allow for dynamic text replacement in each mapped text.

Say you wanted to expand upon the "Welcome" example given in WAX syntax so that you could welcome your site visitor by name and remember his/her place of residence.

WAX document:
<wax:wax xmlns:wax="http://www.morphis.org/wax" version="1.0">
    <wax:doc>
        <wax:block>
            <wax:p>
                <wax:text textid="welcome">
                    <wax:textparam matchid="@!0"> getNameFromWherever()
                    </wax:textparam>
                    <wax:textparam matchid="@!1"> getResidenceFromWherever()
                    </wax:textparam>
                </wax:text>
            </wax:p>
        </wax:block>
    </wax:doc>
</wax:wax>

text xml file:
<lids>
    <lid name="welcome">
        <item>Bienvenue @!0 de @!1</item>
        <langrule>fr</langrule>
    </lid>
    <lid name="welcome">
        <item>Willkommen @!0 aus @!1</item>
        <langrule>de</langrule>
    </lid>
    <lid name="welcome">
        <item>Benvenuto @!0 da @!1</item>
        <langrule>it</langrule>
    </lid>
    <lid name="welcome">
        <item>Bienvenido @!0 de @!1</item>
        <langrule>es</langrule>
    </lid>
    <lid name="welcome">
        <item>Welcome @!0 from @!1</item>
    </lid>
</lids>

Depending upon the values returned from the method calls of getNameFromWherever() and getResidenceFromWherever(), the output for an example user from each country listed above could look something like this:

Output:
        Bienvenue Colette de France
        Willkommen Johann aus Deutschland
        Benvenuto Guieseppe da Italia
        Bienvenido Fabiola de Ecuador
        Welcome Doogie from New Jersey
        
morphis SourceForge Logo