Welcome to WebmasterWorld Guest from 54.205.209.95

Forum Moderators: httpwebwitch

Message Too Old, No Replies

how to put c:if statements in generated HTML

xsl html c:if

   
1:49 am on Oct 12, 2012 (gmt 0)



I am trying to put c:if lines out in the HTML my XSL is creating from the XML

If I use this:

<xsl:text disable-output-escaping="yes"><c:if test="${value=='yes'}"></xsl:text>

when the XSL runs it says the prefix "c" for element "c:if" is not bound ..

If i use like &lt; and &gt; for the < > before/after the c:if.. then the error goes away but my html does not render as needed.

Is there some way to put out this line of text and not have the XSL translation care about the "c:if" ?
11:47 pm on Nov 4, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The prefix needs to be identified in the root of your XSLT.
See [w3schools.com...] where it has this in the root
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
and the following as the if expression.
<xsl:if test="price &gt; 10">

Notice how the xsl: is defined as pointing to XSL Transform namespace.