Assigning the value of xapp:count to an input field

X-Application Version: 4.1.1
Tamino Version : 4.1.1
Platform : Win2k
WebContainer : Tamocat 4.1.1
JDK Version : 1.4.1

How can I assign the value of the xapp:count to an input field? When I try

 <input name="occurCount">
         <xsl:attribute name="value"><xapp:count target="loop0"/></xsl:attribute>
	</input>
  </pre><BR>in the basic.xsl I get the error<BR><pre class="ip-ubbcode-code-pre">regenerate:
     [java] generating search.jsp
     [java] Cannot configure XSLT processor: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: xapp:count is not allowed in this position in the stylesheet!
     [java] Aborted  



However, if I just display it as an output value, it works fine.

Thanks
Elsabe Jacobs

Hello,

the xls transformation of the generator produces JSPs containing X-Application tag, but you can not use xapp:tags within the transformation. The problem is that the Xapp:count tag is evaluated during the transformation. I think that’s not what you want.

In JSPs for the standard < 2.0 it is possible to have text like

<input name="occurCount" value="<xapp:count target='loop0'" /> 



You could use this phrase directly within the JSP. You could also use the xsl:attribute, but have to mark the enclosed value of the attribute as text for the XSL transformator does not try to evaluate the tag.

Bye,
Christian.

Thank you for this.

It works great when I put

<input name="occurCount" value="<xapp:count target='loop0'/>"/>  </pre> in my JSP, but now to get the xsl to generate this!<BR><BR>I tried <pre class="ip-ubbcode-code-pre"><input name="occurCount"><xsl:attribute name="value">		    
<xsl:text disable-output-escaping="yes"><xapp:count target='loop0'/></xsl:text></xsl:attribute>
               </input>
 </pre> but the disable-output-escaping does not work when used within the value of an attribute and the following is generated <pre class="ip-ubbcode-code-pre"><input name="occurCount" value="<xapp:count target='loop0'/>"/>  

which does not have the desired effect in the browser.

I tried using a CDATA section as well but it has the same effect. My stylesheeting skills are letting me down. Is it possible to generate the code I want generated by the xsl or will I have to manually change the JSP?

Thanks
Elsabe Jacobs

Oops, the entities were interpreted. What gets generated is



Regards
Elsabe

Don’t know how I’ll get the message through, what gets generated is the &lt and &gt instead of < and >

What is generated is the ampersand lt and ampersand gt instead of < and >

Hello,

could you try out the following

<input name="occurCount">
  <xsl:attribute name="value"><xsl:text disable-output-escaping="yes"><xapp:count target='loop0'/></xsl:text></xsl:attribute>
</input>



I am not a style sheet expert, but I found some examples within the existing generator style sheets where the ampersand notation was used.

Bye,
Christian.

Hello,

I have the same problem as you the code is

<input name="occurCount">
  <xsl:attribute name="value"><xsl:text disable-output-escaping="yes">ampersand lt;xapp:count target='loop0'/ ampersand gt;</xsl:text></xsl:attribute>
</input>

Hi

This ampersand thing is quite confusing :slight_smile:

I have tried your example (I also got it from the current stylesheets) and it works 100% except when it is used to specify the context of the value attribute. Then the ampersand is retained and the browser ends up showing the value of the field as <xapp:count target=“loop0”> instead of the JSP interpreting the xapp tag and substituting it with a value.

Really not sure how to get past this one, except by changing the generated JSP page to manually replace the ampersand lt and gt with < and >.

Thanks
Elsabe