This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
forms that span other elements
- From: "Jacob P. Glenn" <jpglenn2 at hotmail dot com>
- To: <XSL-List at lists dot mulberrytech dot com>
- Date: Mon, 22 Apr 2002 03:44:33 -0400
- Subject: [xsl] forms that span other elements
- Reply-to: xsl-list at lists dot mulberrytech dot com
Thanx to everyone who helped with my last problem, because of you I was
able to fix it. My new problem is as follows. My stylesheet is working
great for most of my conversions. But I have come across a few files
with forms that span several elements for example:
<body>
<form action="bla" method="get"><input type="hidden" value="T"
name="TypeOfInquiryNumber" />
<table cellspacing="0" cellpadding="0" width="600" border="0">
<tbody>
.
.
.
<tr>
<td>1.</td>
<td><input maxlength="48" size="24" name="InquiryNumber1" /></td>
</tr>
.
.
.
</tbody>
</table>
</form>
</body>
The way my stylesheet is set up is with a template for each element.
The form element is as follows. In writing the form element I did not
anticipate this problem but at the same time I am at a loss for a
solution. How can I do this? What happens now is that it omits
everything within the form element. The form template is below:
<xsl:template match="form"> <!-- Form template to convert XHTML
forms to WML input elements -->
<xsl:apply-templates select="input" >
<!-- Capture the link value for later use -->
<xsl:with-param name='href' select='@action'/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="input">
<input>
<xsl:copy-of select="@name | @size | @maxlength" />
</input>
</xsl:template>
<xsl:template match="input[@type = 'submit']"> <!-- Form with submit
type-->
<!-- Recover the link value using the parameter -->
<xsl:param name='href'/>
<do type="accept" label="{normalize-space(@value)}">
<!-- Go to the specified URL-->
<go href='{$href}'/>
</do>
</xsl:template>
<xsl:template match="input[@type = 'image']"> <!-- Form with image
type-->
<!-- Recover the link value using the parameter -->
<xsl:param name='href'/>
<do type="accept" label="{normalize-space(@alt)}">
<!-- Go to the specified URL -->
<go href='{$href}'/>
</do>
</xsl:template>
Thank you,
Jacob
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list