-----Ursprüngliche Nachricht-----
Von: Christian Haul <[EMAIL PROTECTED]>
An: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to