On Mon, 28 May 2001, declan kelly wrote:
> Hi,
>
> I'm trying to write a page where users can edit their
> details, so I'm pulling their details from the DB and
> trying to put them into a form as the value, simple or
> so I thought. What's happening in practice is that the
> strings I'm putting into the value have a load of
> whitespace around them and are way off the end of the
> input box. I tried using .trim() but it doesn't do
> anything. This is what I'm trying
>
> <input type="text" name="firstName">
> <xsp:attribute name="value">
> <xsp:expr><esql:get-string
> column="firstname"/></xsp:expr>
> </xsp:attribute>
> </input>
try:
<input type="text" name="firstName">
<xsp:attribute name="value"><xsp:expr>
<esql:get-string column="firstname"/>
</xsp:expr></xsp:attribute>
</input>
(xsp:attribute assumes all whitespace is important - probably erroneously,
but you never know).
or if you just can't get that to work:
<input type="{@type}" name="{@name}" maxlength="{@maxlength}" size="{@size}">
<xsl:attribute name="value">
<xsl:call-template name="strip-whitespace">
<xsl:with-param name="arg" select="@value"/>
</xsl:call-template>
</xsl:attribute>
</input>
maybe see esxlt.org or xsltsl.sourceforge.net for a strip-whitespace
xslt function if you can't figure out how to make one.
- donald
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>