XSLT Help

Last post 02-04-2008 11:20 AM by GavDraper. 1 replies.

Sort Posts:

  • XSLT Help

    02-04-2008, 11:03 AM
    • Participant
      871 point Participant
    • GavDraper
    • Member since 07-11-2006, 11:15 AM
    • England
    • Posts 176

    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
  • Re: XSLT Help

    02-04-2008, 11:20 AM
    Answer
    • Participant
      871 point Participant
    • GavDraper
    • Member since 07-11-2006, 11:15 AM
    • England
    • Posts 176

    resolved this in the end there was a problem in the line above it where a tag was left open.

    Please Remember to click "Mark as Answer" on this post if it helped you.
    -------------------
    http://www.crazycoder.co.uk
    G
Page 1 of 1 (2 items)
Microsoft Communities