I've been given a mass of XSLT and XML files and asked to write a program to output the transformation to a file. Whenever I run this program I get the following error
"Attribute and namespace nodes cannot be added to the parent element after a text, comment, pi, or sub-element node has already been added."
I've traced this to line 2 of the following XSLT file. I take it its being caused because the plain text "Next" is within the attribute. I'm not very familiar with XSLT so could anyone give me some pointers on how to correct this?
<xsl:if test="$next!=''">
<xsl:attribute name="title">next</xsl:attribute>
<xsl:attribute name="onclick">location.href='<xsl:value-of select="$next"/>'</xsl:attribute>
<xsl:attribute name="onkeypress">return true</xsl:attribute>
<xsl:attribute name="onkeypress">return true</xsl:attribute>
</xsl:if>
Please Remember to click "Mark as Answer" on this post if it helped you.
-------------------
http://www.crazycoder.co.uk
G