[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Variable Substitution In A Select Statement
On 24/05/2011 14:07, Raymond Lillibridge wrote:
xsl-list Members, actually having evaluation at run time is quite a big thing 9and not available in most languages) as it means having all the parsing machinery available which is not normally in the compiled code. If you have a string x with value " + 2" in C or java or fortran or ... you can't just go 3 x and have it expand to 3 + 2 and evaluate to 5. However for some reason it's quite common to expect that xslt has this feature. to use saxon:evaluate you need to declare the saxon extension namespace then something like saxon:evaluate(concat('$FileA,'/',$Axpath_new.'/@id')) ie build up the xpath you want to evaluate as a single string then pass it to the function. You didn't say why you are needing evaluation though, are you picking up the xpaths from an external file? otherwise it may be better to store the sequence of nodes selected by book/level1[2]/level 2[4]/section[2] in a variable, rather than the string "book/level1[2]/level 2[4]/section[2]" then you could just do $variable/'id to select the id attributes. David David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|