How to get a readonly tag into an input

  • Thread starter Cecil Westerhof
  • Start date
C

Cecil Westerhof

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?
 
J

Johannes Koch

Cecil said:
<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"
 
P

Peter Flynn

Cecil said:
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
 
C

Cecil Westerhof

Peter said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top