Joshua J Wulf [mailto:] wrote:
> I'd like to do the following with an xsl template:
>
> If a section or chapter contains an immediate child section with the
> same title, then
> delete the child's<section/> and<title/> tags, but not the contents
> between the child<section> and</section>.
I think that you want to do something like the following (untested), though you might have to tweak the details. I'm guessing that the situation you are thinking of is that you have a chapter with only a single section in it. (This code does not actually test to make sure that there are no other sections within the chapter, but it could be made to do so.)
<xsl:template match="section">
<xsl:choose>
<xsl:when test="string(title) = string(../title)">
<xsl:apply-templates select="*[not(name() = 'title']" />
</xsl:when>
<xsl:otherwise>
<!-- NORMAL SECTION PROCESSING -->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
*************************
Rob Cavicchio
Principal Technical Writer & Information Architect
Information Intelligence Group
EMC Corporation
The opinions expressed here are my personal opinions. Content published here is not read or approved in advance by EMC and does not necessarily reflect the views and opinions of EMC.