cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Nuetzel - inglobo" <peter.nuet...@inglobo.de>
Subject Re: [RT] forms
Date Fri, 20 Jul 2001 16:10:22 GMT
-----Urspr√ľngliche Nachricht-----
Von: Christian Haul <haul@dvs1.informatik.tu-darmstadt.de>
An: cocoon-dev@xml.apache.org <cocoon-dev@xml.apache.org>
Datum: Freitag, 20. Juli 2001 16:21
Betreff: Re: [RT] forms


>On 19.Jul.2001 -- 09:17 PM, Peter Nuetzel - inglobo wrote:
>> >Why do you use xalan:evaluate() to fill in the data?
>> >
>>
>> I need it to evaluate the XPath values of the ref attributes of the form
>> controls.
>> example:
>>
>> <form-descriptor>
>>     <instance>
>>         <person>
>>             <firstname>Paul</firstname>
>>             <lastname/>
>>         </person>
>>     </instance>
>>     <form>
>>         <textbox ref="person/firstname">
>>             <caption>First Name</caption>
>>         </textbox>
>>         ...
>>     </form>
>> </form-descriptor>
>>
>> to transform this to HTML the following stylesheet may be used:
>> ...
>> <xsl:variable name="instance" select="/form-descriptor/instance"/>
>>
>> <xsl:template match="textfield">
>>      <xsl:value-of select="caption"/>
>>      <input type="text" value="{xalan:evaluate(concat('$instance/',
>> @ref))}">
>>      </input>
>> </xsl:template>
>> ...
>>
>> AFAIK there is no possible solution with pure XSLT. An alternative would
be
>> a Transformer which fills in the data.
>> I think there is also some kind of intermediate format necessary which
>> represents the evaluated form. I think adding the evaluated values as
>> elements to the form controls like you proposed in your last mail is a
nice
>> solution. So you get a simple and straight XML document which may be
easily
>> transformed to special presentations by user stylesheets.
>
>Would a <xsl:attribute> do it?
>
><xsl:template match="textfield">
>     <xsl:value-of select="caption"/>
>     <input type="text">
>        <xsl:attribute name="value">
>    <xsl:value-of select="concat('$instance/',@ref)"/>
>        </xsl:attribute>
>     </input>
></xsl:template>
>
>
> Chris.
>


I'm sorry no, only the concat() function is evaluated not the resulting
xpath.

- peter





---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message