How to determine the inner context node within an XSLT select

Posted by Marcus Rickert on Stack Overflow See other posts from Stack Overflow or by Marcus Rickert
Published on 2010-05-26T11:42:33Z Indexed on 2010/05/26 11:51 UTC
Read the original article Hit count: 222

Filed under:

Hi there!

I'm trying to determine a subset of nodes stored in the variable objs by using a user defined function cube:is_active:

    <xsl:variable name="active_cubes" select="$objs[cube:is_active(XXX) = 'TRUE']"/>

Since the function does not allow a local context I'm required to pass it as a parameter (denoted by XXX). However, the usual suspects "." or "current()" do not work since they refer to context node of the surrounding block and NOT to the current element of objs which is evaluated.

The only solution so far which DOES work is:

XXX=SOME_CHILD_TAG/..

But this is really ugly since it depends on the existence of the child tag for the parent node to work correctly.

Is there any other way? Thanks!

© Stack Overflow or respective owner

Related posts about xslt