[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: A beef with XSLT Sometimes too complicated
At 05:36 PM 7/17/2006, you wrote:
> So -- if I follow you -- nesting a for expression is a workaround for > this gap only some of the time? Ah. but there is _no_ way in XPath to bind a value to a variable x such that count($x) has any value other than 1. so let $x := () return ... and let $x := (1,2) return ... have no analogue in XPath. Ah-hah. I think what's impeding my brain here is simply my inexperience with query languages in general, and in particular with applications of let constructs with variable cardinality (using the word "variable" as English, not XPath :-). (Outside the XSLT context, of course.) Now, transformations I have experience with.... It does occur to me that what we are facing is a collective coming-to-grips with the question of queries-as-transformations and transformations-as-queries, both in the design choices made by the committees (facing their various requirement sets) and by the user communities who then use those designs. I'm inclined to think of queries as a subset of transformations, but then I would think that. Stepping back I suppose it's probably possible to define each in terms of the other. And it does seem that in the real world, transformations always include some query component (even if implicit as in <xsl:apply-templates/>) while queries mostly include some transformation component (or can be seen as transformations in themselves). When XPath is used in XSLT it's only a minor inconvenience, you just drop back into xslt and use <xsl:variable name="x" select="()"/> <xsl:variable name="x" select="(1,2)"/> It might be more of a "problem" in oher XPath API, although less of a problem than those API for XPath1, which don't let you bind variables at all, as XPath1 has no binding expressions. I think you mean the "XSLT Way" here, in Carlislese? The fact that often you can get an xpath solution from an xquery solution by replacing any let by for means that people will try that, but it's only safe to do if you know the cardinality of the expression being bound is always 1 (which you are unlikely to know if it's just some code found on the web) I feel a faq coming on in this area... Right. Cheers, Wendell
|
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
|