1

Topic: xslt to break off a tag

<xsl:if test = "some_tag/text ()"> <b> </xsl:if>
.....
The big piece xml
.....
<xsl:if test = "some_tag/text ()"> </b> </xsl:if>

It is necessary on a condition to format big piece xml (for xslt), for example, to select fat.
But as though to make correctly, without doubling two times this big xsl, and to break off a tag <b> as in an example does not give.

2

Re: xslt to break off a tag

<span>
<xsl:if test = "some_tag/text ()">
<xsl:attribute name = "style"> font-weight:bold </xsl:attribute>
</xsl:if>
The big text
</span>

3

Re: xslt to break off a tag

Or so

<xsl:if test = "some_tag/text ()"> <b> <xsl:call-template name = "big"/> </b> </xsl:if>
<xsl:if test = "not (some_tag/text()"> <xsl:call-template name = "big"/> </xsl:if>
<xsl:template name = "big">
The big piece xml
</xsl:template>

4

Re: xslt to break off a tag

Antonariy, thanks

5

Re: xslt to break off a tag

<xsl:choose>
<xsl:when test = "some_tag/text ()"> <b> <xsl:call-template name = "big"/> </b> </xsl:when>
<xsl:otherwise> <xsl:call-template name = "big"/> </xsl:otherwise>
</xsl:choose>