xsl-list
[Top] [All Lists]

RE: Test for current node being an element or attribute?

2002-12-10 12:07:49
Maby generate-id()=generate-id(../namespace::*) ??


-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Dimitre
Novatchev
Sent: terça-feira, 10 de Dezembro de 2002 18:40
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Test for current node being an element or attribute?



"Michael Kay" <michael(_dot_)h(_dot_)kay(_at_)ntlworld(_dot_)com> wrote in 
message
news:000601c2a060$f5b8d1b0$6401a8c0(_at_)pcukmka(_dot_)(_dot_)(_dot_)

what about:

<xsl:if test="../@*[current()]">


Stop guessing, and read the spec.

current() returns a node-set. When used in a predicate, [current()] 
returns true if the node-set is non-empty. It is.


OK, here's one correct test if the current node is an attribute:

count(. | ../@*) = count(../@*) 


Can you, friends, guess how to test if the cirrent node is a namespace?
:o)




=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list