xhtml to wml transformation using xsl
Hi, i am converting convert xhtml pages to wml. now i m stuck in converting xhtml from data.
my problem is that xhtml support form. while in wml there are no forms. i know the syntex to transfer data from wml to other servlet/jsp. but i have to convert 1st xhtml form to wml using XSL. which i do in the follwoing way. but which is not the required output.
//////////////// XHTML PAGE //////////////
<html>
<head>
<title>Ooober::: index</title>
</head>
<body>
<img src="\images\ooober_logo_s.png" alt="ooober logo" />
<form action="form_action.asp" method="get">
Id:
<input type="text" name="fname" value="Mickey" />
password :
<input type="text" name="lname" value="Mouse" />
<input type="submit" value="Submit" />
</form>
</body>
</html>
-- XSL CODE to convert from xhtml to wml.
<!-- input field-->
<xsl:template match="input">
<input name="{attribute::name}" type="{attribute::type}" size="attribute::size">
<xsl:apply-templates/>
</input>
</xsl:template>
<!-- form to anchor/go thing :P-->
<xsl:template match="form">
<anchor>
<go method="{attribute::method}" action="{attribute::action}">
<xsl:apply-templates/>
</go>
</anchor>
</xsl:template>
out put
<?xml version="1.0" encoding="UTF-8"?><wml><card id="menu" title="Test Page 1">
<img src="\images\ooober_logo_s.png" alt="ooober logo" width="" height=""/>
<anchor><go method="get" action="form_action.asp">
Id:
<input name="fname" type="text" size="attribute::size"/>
password :
<input name="lname" type="text" size="attribute::size"/>
<input name="" type="submit" size="attribute::size"/>
</go></anchor>
</card></wml>
- required out put must be like it.
<wml>
<card id="card1" title="WML Form">
<onevent type="onenterforward">
<refresh>
<setvar name="my_temp_id" value="123456"/>
</refresh>
</onevent>
Hello, welcome to our WML tutorial.
What's your name?
<input name="myName"/>
Are you a boy or a girl?
<select name="myGender">
<option value="Boy">I am a boy</option>
<option value="Girl">I am a girl</option>
</select>
Which part of our WML tutorial do you like?
<select name="favorite_tutorial_part" multiple="true">
<option value="Part 1">Part 1</option>
<option value="Part 2">Part 2</option>
<option value="Part 3">Part 3</option>
<option value="Part 4">Part 4</option>
</select>
<anchor>
<go method="get" href="processing.asp">
<postfield name="name" value="$(myName)"/>
<postfield name="gender" value="$(myGender)"/>
<postfield name="tutorial_part" value="$(favorite_tutorial_part)"/>
<postfield name="temp_id" value="$(my_temp_id)"/>
</go>
Submit Data
</anchor>
</card>
</wml>
//////////////////////
means in this way we submit valuse to any jsp/servlet in wml. now please tell me how to write my XSL so that i get such output.
--
Kind Regards,
qasitouch.
[3541 byte] By [
qasitoucha] at [2007-11-27 10:39:30]

Hi, i am converting convert xhtml pages to wml. now i m stuck in converting xhtml from data.
my problem is that xhtml support form. while in wml there are no forms. i know the syntex to transfer data from wml to other servlet/jsp. but i have to convert 1st xhtml form to wml using XSL. which i do in the follwoing way. but which is not the required output.
//////////////// XHTML PAGE //////////////
<html>
<head>
<title>Ooober::: index</title>
</head>
<body>
<img src="\images\ooober_logo_s.png" alt="ooober logo" />
<form action="form_action.asp" method="get">
Id:
<input type="text" name="fname" value="Mickey" />
password :
<input type="text" name="lname" value="Mouse" />
<input type="submit" value="Submit" />
</form>
</body>
</html>
-- XSL CODE to convert from xhtml to wml.
<!-- input field-->
<xsl:template match="input">
<input name="{attribute::name}" type="{attribute::type}" size="attribute::size">
<xsl:apply-templates/>
</input>
</xsl:template>
<!-- form to anchor/go thing :P-->
<xsl:template match="form">
<anchor>
<go method="{attribute::method}" action="{attribute::action}">
<xsl:apply-templates/>
</go>
</anchor>
</xsl:template>
out put
<?xml version="1.0" encoding="UTF-8"?><wml><card id="menu" title="Test Page 1">
<img src="\images\ooober_logo_s.png" alt="ooober logo" width="" height=""/>
<anchor><go method="get" action="form_action.asp">
Id:
<input name="fname" type="text" size="attribute::size"/>
password :
<input name="lname" type="text" size="attribute::size"/>
<input name="" type="submit" size="attribute::size"/>
</go></anchor>
</card></wml>
- required out put must be like it.
<wml>
<card id="card1" title="WML Form">
<onevent type="onenterforward">
<refresh>
<setvar name="my_temp_id" value="123456"/>
</refresh>
</onevent>
Hello, welcome to our WML tutorial.
What's your name?
<input name="myName"/>
Are you a boy or a girl?
<select name="myGender">
<option value="Boy">I am a boy</option>
<option value="Girl">I am a girl</option>
</select>
Which part of our WML tutorial do you like?
<select name="favorite_tutorial_part" multiple="true">
<option value="Part 1">Part 1</option>
<option value="Part 2">Part 2</option>
<option value="Part 3">Part 3</option>
<option value="Part 4">Part 4</option>
</select>
<anchor>
<go method="get" href="processing.asp">
<postfield name="name" value="$(myName)"/>
<postfield name="gender" value="$(myGender)"/>
<postfield name="tutorial_part" value="$(favorite_tutorial_part)"/>
<postfield name="temp_id" value="$(my_temp_id)"/>
</go>
Submit Data
</anchor>
</card>
</wml>
//////////////////////
means in this way we submit valuse to any jsp/servlet in wml. now please tell me how to write my XSL so that i get such output.
--
Kind Regards,
qasitouch.
Hey, I've got a definition for you --
Definition of presumptuous:
Full of presumption; presuming; overconfident or venturesome;
audacious; rash; taking liberties unduly; arrogant; insolent; as, a
presumptuous commander; presumptuous conduct.
as in: he presumptuously assumed that there
existed someone stupid enough who would wade
and wallow through that muck and mire of thick and
gooey unformated xml code. He waited in vain.
Message was edited by:
petes1234