If it needs to be completely dynamic, then you need something like
saxon:evaluate(), and you need to solve the problem with the apostrophes ;-)
One way to do that (and also to protect against code injection) is to
generate a call using parameters:
saxon:evaluate("*[@type = $p1 or @type=$p2]", 'mc', 'ti')
But I wonder if it does need to be completely dynamic? Would
<xsl:variable name="x" select="('mc', 'ti')"/>
<... *[@type = $x] >
solve the problem?
Michael Kay
Saxonica
On 25/05/2012 10:55, Jesper Tverskov wrote:
Hi
I need to create predicates like the following dynamically:
[@type = 'mc' or @type='ti']
I need the full content of the predicate to be created in a variable
"x", to be inserted in the predicate like:
//qa [$x]
I have tried using saxon:evaluate() but run into problems with
apostrophes. What to do?
Cheers
Jesper Tverskov
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail:<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--