Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - How to get a readonly tag into an input

 
Thread Tools Search this Thread
Old 02-08-2007, 09:25 PM   #1
Default How to get a readonly tag into an input


I have the following code in a xslt-file:

<xsl:template match="outputfield">
<xsl:for-each select='.'>
<tr>
<td class = "inputDescription"><xsl:value-of select='.' />:</td>
<td><input class = "content" id = "{@id}" /></td>
</tr>
</xsl:for-each>
</xsl:template>

I would like to have:

<xsl:template match="outputfield">
<xsl:for-each select='.'>
<tr>
<td class = "inputDescription"><xsl:value-of select='.' />:</td>
<td><input readonly class = "content" id = "{@id}" /></td>
</tr>
</xsl:for-each>
</xsl:template>

To make the input readonly. But with this change the processor crashes. How
can this be done?



Cecil Westerhof
  Reply With Quote
Old 02-08-2007, 09:39 PM   #2
Johannes Koch
 
Posts: n/a
Default Re: How to get a readonly tag into an input

Cecil Westerhof schrieb:
> <xsl:template match="outputfield">
> <xsl:for-each select='.'>
> <tr>
> <td class = "inputDescription"><xsl:value-of select='.' />:</td>
> <td><input readonly class = "content" id = "{@id}" /></td>
> </tr>
> </xsl:for-each>
> </xsl:template>
>
> To make the input readonly


readonly="readonly"
--
Johannes Koch
Spem in alium nunquam habui praeter in te, Deus Israel.
(Thomas Tallis, 40-part motet)
  Reply With Quote
Old 02-08-2007, 11:40 PM   #3
Peter Flynn
 
Posts: n/a
Default Re: How to get a readonly tag into an input

Cecil Westerhof wrote:
> I have the following code in a xslt-file:
>
> <xsl:template match="outputfield">
> <xsl:for-each select='.'>
> <tr>
> <td class = "inputDescription"><xsl:value-of select='.' />:</td>
> <td><input class = "content" id = "{@id}" /></td>
> </tr>
> </xsl:for-each>
> </xsl:template>


What is the purpose of the redundant for-each loop in this template?

///Peter
  Reply With Quote
Old 02-09-2007, 05:49 AM   #4
Cecil Westerhof
 
Posts: n/a
Default Re: How to get a readonly tag into an input

Peter Flynn wrote:

> Cecil Westerhof wrote:
>> I have the following code in a xslt-file:
>>
>> <xsl:template match="outputfield">
>> <xsl:for-each select='.'>
>> <tr>
>> <td class = "inputDescription"><xsl:value-of select='.' />:</td>
>> <td><input class = "content" id = "{@id}" /></td>
>> </tr>
>> </xsl:for-each>
>> </xsl:template>

>
> What is the purpose of the redundant for-each loop in this template?


It is possible to hace severall outputfields in the inputfile and they
should all be transformed.

  Reply With Quote
Old 02-09-2007, 05:51 AM   #5
Cecil Westerhof
 
Posts: n/a
Default Re: How to get a readonly tag into an input

Johannes Koch wrote:

> Cecil Westerhof schrieb:
>> <xsl:template match="outputfield">
>> <xsl:for-each select='.'>
>> <tr>
>> <td class = "inputDescription"><xsl:value-of select='.' />:</td>
>> <td><input readonly class = "content" id = "{@id}" /></td>
>> </tr>
>> </xsl:for-each>
>> </xsl:template>
>>
>> To make the input readonly

>
> readonly="readonly"


This works. Thanks.

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump