[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: A really easy (hopefully) question

Subject: Re: A really easy (hopefully) question
From: Uche Ogbuji <uche.ogbuji@xxxxxxxxxxxxxxx>
Date: Fri, 09 Feb 2001 07:27:01 -0700
Re:  A really easy (hopefully) question
> > The "current node" and "current node list" are XSLT concepts,
> > not XPath
> > concepts. What would you expect current() to return in
> > another non-XSLT implementation of XPath?
> 
> It would be quite easy to define it as "the node that is the context node
> for the XPath expression as a whole, outside any predicates". I assume
> no-one thought that would be useful enough to justify it.

4XPath doesn't, but I do agree that it makes some sense.  We'd probably 
require current() to be qualified with the XSLT namespace if used in 
free-standing 4XPath.

> It would be interesting to know whether free-standing XPath implementations
> actually provide this function or not. As far as I can see neither
> Microsoft's nor Xalan's free-standing XPath processors give you any
> (documented) way of defining variables, which ARE part of the XPath spec.

In 4XPath this looks like

from xml.xpath.Context import Context
from xml.xpath import Evaluate
vars = {('http://spam.com', 'sillyvar'): 'hello world'}
nss = {'pref': 'http://spam.com'}
con = Context(dom_node, varBindings=vars, processorNss=nss)
result = Evaluate('$pref:sillyvar', context=con)

Quick n dirty Python primer for the above

{a: b, c: d} is a dictionary or associative array with a & c as the keys and b 
& d as the values.
(a, b, c) is a tuple of values, similar to a list


-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@xxxxxxxxxxxxxxx               +1 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.