RE: [xsl] Problem with Checking for a node.

Subject: RE: [xsl] Problem with Checking for a node.
From: "Aron Bock" <aronbock@xxxxxxxxxxx>
Date: Mon, 11 Jul 2005 12:14:14 +0000
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@xxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: "XSL (E-mail)" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
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/


Current Thread