Hi!

I am using a xslt-mapping table to determine the placement of an object
based on a xml-object.

The code (thanks to those posting it years ago here) looks like the
following:
xml-object (mapping Table)

<xsl:variable name="ctxmap">
<row>
<ndsctx>\IDM-3TREE\usr\ORG1\ORG2</ndsctx>
<adctx>OU=Dep1,OU=Organization,OU=company</adctx>
</row>
<row>
<ndsctx>\IDM3TREE\usr\ORG1\ORG3</ndsctx>
<adctx>OU=Dep2,OU=Organization,OU=company</adctx>
</row>
<row>
</xsl:variable>

This one is read in by a xslt-script:

<!-- read in mapping tables -->
<xsl:variable name="ctx-map"
select="document('../dev_nds2ads-ctx')//xsl:variable[@name='ctxmap']"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!-- translate operation attribute "op-reg" into real target using
mapping table-->
<xsl:template match="/nds/input/add/operation-data/@op-ndsctx">

<!-- the select expression of this variable definition does the
mapping. if the first part (ndsctx) matches the
the value of op-attribute, the second part is
used. -->
<xsl:variable name="ctx-text"
select="$ctx-map/row[string(ndsctx)=string(current())]/adctx/text()"/>

This one matches exactly on a context and works fine.
What I am trying to approach is to have something like a "Subtree"
functionality.

I tried:

<!-- the select expression of this variable definition does a loosy
mapping. if the first part (reg) starts with the the value of
op-attribute, the second part is used. This behavour acts like the
subtree argument in policy builder -->

<xsl:variable name="ctx-text"
select="$ctx-map/row[string(starts-with(string(nsdctx),string(current())))]/adctx/text()"/>

Which matches always the first node. So how to use a function inside a
predicate? eg $variable/node[where node starts with]/acctx/text()

Thorsten