XSLT giving unwanted data in output
This is an open discussion with 4 replies, filed under XSLT.
Search
oops - top part of xslt should read:
<xsl:template match="project-detail/entry"> <h2><xsl:value-of select="title"/></h2> <p>Last Update: <xsl:value-of select="date"/></p> <p>Images:</p> <ul> <xsl:apply-templates match="images/item"/> </ul> <p>Content:</p> <xsl:copy-of select="content/*"/> </xsl:template>
Hi Dave, my guess is that this has something to do with the XSLT 'default' template rules. This basically outputs the text when no other template matches (hope I explain this properly).
I cannot see how this works here, though, since your /project/entry
is matched, as is your /image
in there...
woops I see it now. Your xsl:apply-templates
has a match
attribute where it should be a select
I believe.
Try: <xsl:apply-templates select="images/item"/>
Cheers David! Thats fixed it.
Create an account or sign in to comment.
Hi
I'm new to the forums here but have been using Symphony for a number of projects and love it.
I am stuck with a problem with the current project I am working on when trying to output images that are stored using subsection manager.
Here is my xslt:
Last Update:
Images:
Content:
And my XML:
But my HTML output looks like this:
In other words when it gets to applying the template to ouput the images it first outputs the raw xml before the correctly formatted images.
Has anyone got any suugestions?
Thanks in advance, Dave