xsl-list
[Top] [All Lists]

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

2008-09-18 03:39:36
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="{(_at_)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>


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--