cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Blake <>
Subject Conditionally adding anchors
Date Thu, 31 Jan 2002 04:59:54 GMT
Hi again,

I solved the previous problem - the code to make it work is in this post.

A quickie, I hope :)

The following XSL generates the error:
org.apache.cocoon.ProcessingException: Error in creating Transform 
Handler: org.xml.sax.SAXParseException: The element type "a" must be 
terminated by the matching end-tag "</a>".

I am wanting to conditionally make an anchor around some other elements 
(an icon and text) and tried the following. It didn't work for obvious 
reasons. What is the best practice to achieving this.

<!-- Is this an anchor? open it -->
<xsl:if test="url">
	<a href="{url}">
<!-- Add any icon -->
<xsl:if test="icon">
	<img border="0" src="images/icons/{icon}"/>
<span class="listlabel">
	<xsl:variable name="selectorValue" select="selector"/>
	<xsl:variable name="displayValue" 
	<xsl:value-of select="$displayValue"/>
<!-- Is this an anchor? close it -->
<xsl:if test="url">

Thanks for your time,


Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message