Andrew Truckle
Andrew Truckle

Reputation: 19107

How do I force the XSL to write this out with a closing tag?

I have this XSL snippet:

     <xsl:if test="@BookmarkId">
        <a>
          <xsl:attribute name="name">
            <xsl:value-of select="concat('week', @BookmarkId)"/>
          </xsl:attribute>
        </a>
      </xsl:if>

The output is:

<a name="week1"/>

But in this instance I require it to be:

<a name="week1"></a>

How can I do this?

Thank you.

Upvotes: 0

Views: 31

Answers (1)

Hikmat
Hikmat

Reputation: 460

Please use this solution

 <xsl:if test="@BookmarkId">
    <a>
      <xsl:attribute name="name">
        <xsl:value-of select="concat('week', @BookmarkId)"/>
      </xsl:attribute>
      <![CDATA[ ]]>
    </a>
  </xsl:if>

Upvotes: 2

Related Questions