Re: [xsl] Display text and all the following nodes except <anchor> and <pb>

Subject: Re: [xsl] Display text and all the following nodes except <anchor> and <pb>
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Thu, 18 Sep 2008 10:39:04 +0300
Hi,

Just match on the head/pb and head/anchor and do not generate any output for them:

    <xsl:template match="head">
        <h1><xsl:apply-templates/></h1>
    </xsl:template>
    <xsl:template match="sCap|person">
        <span class="{name()}"><xsl:apply-templates/></span>
    </xsl:template>
    <xsl:template match="anchor">
        <a name="{@id}"><xsl:apply-templates/></a>
    </xsl:template>

<xsl:template match="head/anchor|head/pb"/>

Best Regards,
George
--
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

J. S. Rawat wrote:
Can anyone help me to get the desire output!!! I want all the text/following element except <pb> and <anchor> within <h1>

INPUT
<head>O<sCap>FFICERS</sCap> of <person>the</person> R<sCap>EGIMENT</sCap> of
I<sCap>NFANTRY</sCap><anchor id="J">anchor</anchor><pb n="2"/>2</pb>
</head>
<anchor id="c">anchor1</anchor>


OUTPUT
<h1>O<span class="sCap">FFICERS</span> of <span class="personn">the</span> R<span class="sCap">EGIMENT</span> of I<span class="sCap">NFANTRY</span></h1>
<a name="c"/>anchor1</a>

Current Thread