I'm having a XSLT problem.
I am reading from one xml sheet and creating another using XSLT. The final transformed XML has an element <Recreations> that contains <Recreation> elements. I am using <xsl:for-each> to create the <Recreation> elements. So my xslt looks something like this:
<Recreations>
<xsl:for-each select="MyItems">
<xsl:if select="cust:isThisARecreation(@Description)>
<Recreation>
<xsl:value-of select="@Description">
</Recreation>
</xsl:if>
</xsl:for-each>
</Recreations>
So: isThisARecreation function is a custom Java function. The <Recreations> element could contain zero to many <Recreation> elements. If there are no <Recreation> elements then I have to remove the <Recreations> element.
I have to go through the loop to know if there are Recreation elements. If there aren't I don't need it's parent element. Anyone have any ideas on how I might do this?
Thanks,
Ben