xsl-list
[Top] [All Lists]

RE: Problem with Checking for a node.

2005-07-11 05:14:14
Lakshmi Narayana,

If you want to specially process C nodes (or non-C nodes), the "XSL way" would probably be to have a null template that explicitly matches C nodes. This was illustrated by a prior respondent:

<xsl:template match="C"/>

This gives you the option of affecting C nodes in a specific template, and of processing non-C nodes elsewhere (in a different template), without an explicit "switch".

If you just want to ignore non-C nodes you could also do:

<xsl:template match="node()[not (self:C)]|@*">
...
</xsl:template>

Regards,

--A

From: "Lakshmi narayana" <lchintala(_at_)osi-tech(_dot_)com>
Reply-To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
To: "XSL (E-mail)" <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: [xsl] Problem with Checking for a node.
Date: Mon, 11 Jul 2005 15:07:39 +0500


Hi
<A name="A">
        <B name="dyd>
        <C name = "ttt>
        <D name = "ggg>
</A>

I want an xslt for this psuedo code.
<xsl:template-match="/">
        <xsl:apply-template />
</xsl:template>
<xsl:template match="node()|@*">
    If(the current node is not C){
        ----some action
    }
< xsl:apply-template />
</xsl:template>

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>