Yes, although the context node upon which the XPath is evaluated is in another XML document altogether. Upon first glance, dyn:evaluate seem to use the current context, and thus the same XML document, when evaluating the XPath.
Otoh, I might very well be missing something. I'm quite new to XSLT... ;) /Rob > -----Original Message----- > From: Mark Weaver [mailto:[EMAIL PROTECTED] > Sent: Monday, April 28, 2003 12:21 PM > To: [email protected] > Subject: RE: Best way to create a XalanNode inside an > extension function > > > Sounds a bit like > http://exslt.org/dyn/functions/evaluate/index.html? > > > -----Original Message----- > > From: Bielik, Robert [mailto:[EMAIL PROTECTED] > > Sent: 28 April 2003 06:32 > > To: [email protected] > > Subject: RE: Best way to create a XalanNode inside an > extension function > > > > > > I don't know if this is pertinent to the original question, but I > > have scenario where I have > > an XML with data to be transformed by XSL. However, in order to > > do this the XSL may need extra > > information which I didn't want to import into the main XML due > > to having several XSL:s each needing > > its own extra info. > > > > So I solved it this way: For each XSL I create a new > > XalanDocument that contains the info that the > > particular XSL need. Then I provide an extension function > > "myInfo(...)" that takes a string as argument. > > This argument is then evaluated as an XPath in the new > > XalanDocument (external to transform) and returns a result tree > > fragment. And it seems to work nicely, not having to copy the XSL > > specific data into the main XML. > > > > I've only tested returning nodesets, and that seems to be working > > nicely. However, I see no reason (yet) > > why the function couldn't return an entire tree fragment that in > > turn would be XPath-able. > > > > If this is different from creating XalanNodes from scratch, I > > apologize for the digression. > > > > Note: The XObjectPtr returned from the XPathEvaluator must be > > cloned upon returning it from the > > extension function (but you all know this kind of stuff > already... :) > > > > Regards > > /Rob
