What i meant was:

<template match="*">
        <xsl:apply-templates select="xalan:evaluate($xpath)" 
mode="my-xpath-mode"/>
</template>

<template match="*" mode="my-xpath-mode">
        <choose>
                <!-- Or any other check -->
                <when test="contains($xpath,'sth')">
                        Do sth with nodes when the xpath contains "sth"
                </when>
                <otherwise>
                        Do sth else
                </otherwise>
        </choose>
</template>

Ah, just one mode string. Ever used this approach? With the evaluate in it I 
mean?

And the above example would match the xpath expression contained in
$xpath doesn't it? (That was the Goal i thought.)

Though I'm not the problem owner (so don't ask me about the goal ;), i think this approach with apply-templates is useful in only limited situations. The original posted tried to test for certain xpaths. That can be done with the apply-templates, somehow, I guess. But the one that suggested to generate an XSL had a different use case, in which most is copied and the xpath matching elements were only marked. In that case apply-templates is not that useful...

:-P

Cheers,
Geert

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to