[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Can't have both " and ' in an XPath lite
At 2006-04-23 04:45 +0200, rolf@xxxxxxxxxxxx wrote:
Thanks for answering Ken, but ... But concat() is part of XPath, not XSLT. Imagine a script language (in fact, that's the real scenario), which got a DOM tree and is able to execute XPath expressions on that tree. Now, the programmer want to select the elements with an attribute x with an attribute value given by outside (say: user input). So, then, that value would be in a variable? If you want to programmatically create the needed XPath expr (simplified something like: e[@x='<that random value comming from elsewhere, you've no control over>']) In no case can it be totally without control. then the question arises how to escape the XPath literal delimiter character in that string.
select="e[@att=$val]" There is no way to escape the XPath literal delimiter character within a literal with the XPath syntax rules, as you confirm. OK, in the scribbled case, the programmer could write a complex parsing rule, to rewrite the wanted expression along the line you showed, but that is, to word tempered, tedious. Well, all I can think of without spending a lot of time thinking about it is variables, and XPath has a context of evaluation in which bound variables in scope are available to be used. I hope this helps. . . . . . . . . Ken -- Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16 Also for XSLT/XSL-FO training: Minneapolis, MN 2006-07-31/08-04 Also for XML/XSLT/XSL-FO training:Birmingham,England 2006-05-22/25 Also for XSLT/XSL-FO training: Copenhagen,Denmark 2006-05-08/11 World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
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
|