Welcome to WebmasterWorld Guest from

Forum Moderators: open

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)

New User

5+ Year Member

joined:Oct 12, 2012
posts: 1
votes: 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)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:May 31, 2005
votes: 0

The prefix needs to be identified in the root of your XSLT.
See [w3schools.com...] where it has this in the root
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.