Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Wolfgang Hoschek <wolfgang.hoschek@ma...> - 2005-12-05 23:18:10
|
The saxon:evaluate extension function should do the trick. Wolfgang. On Dec 5, 2005, at 3:12 PM, Tom Voltz wrote: > I have been banging my head against the wall on this one problem, =20 > and thought saxon experts might have some ideas. (I=92m using XSLT =20= > 2.0 for this project..) > > > I have built up a variable that will help me locate a specific node =20= > in my document as follows: > > > <xsl:variable name=3D"argument_xpath">/command<xsl:for-each =20 > select=3D"remove(tokenize(path,'\s+'),1)">/parm_list/argument=20 > [name=3D'<xsl:value-of select=3D"."/>']</xsl:for-each> > > > Given the value of path is =93clock set time=94, > > The result of the code above is: > > =93/command/parm_list/argument[name=3D'set']/parm_list/argument=20 > [name=3D'time']=94 > > > However, I can not for the life of me figure out how to get this to =20= > be parsed by Saxon as an xpath expression instead of a string value: > > <xsl:for-each select=3D=94=92$argument_xpath=92=94> . . . > > Does not work, nor does the variation: > > <xsl:for-each select=3D=94=92/command/$argument_xpath=92=94> . . = (Assuming I =20 > truncated the variable so this is a correct xpath that will find =20 > the target node.) > > > I can of course use variables within an xpath expression, in some =20 > contexts: > > //command[name=3D=92$x=92] for example works like a charm. > > > Any hints or ideas on how to get Saxon to treat an entire $variable =20= > as an xpath expression to be evaluated against the main document? > > > > Tom > > > |