Scott,
I would have been surprised if you wouldn't have raised the performance
issue. I was thinkin about that myself.
To explain my case a little further:
In XForms there can be calculations between XML nodes. These calculcations
are arbitrary XPath expressions. So, if one node value changes, all the
nodes that have calculations that reference that node must be recalculated.
The user does not determine the calculation order, it is up to the
implementor. This is a similar problem that is solved in spreadsheet
programs such as Excel.
I have an algorithm to solve this problem (along with circular reference
detection), but I need to find out which nodes are read in each XPath
expression.
This problem will be around for all similar calculation systems that use
XPath to update information in the XML DOM.
Maybe a better performing approch of getting this information would be to
add interface to the org.apache.xpath.Expression, which would allow reading
the expression tree after compilation. That way the actual XPath execution
would remain untouched. Does this sound more doable? Would it be possible to
do an interface like this?
Thanks for your attention,
- Mikko Honkala - http://www.x-smiles.org/
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 8. elokuuta 2001 17:47
> To: [EMAIL PROTECTED]
> Subject: RE: Xalan-J: list of referenced DOM nodes for an XPath
> expression?
>
>
>
> > Would it be sensible to define an Interface
> > similar to XSLT's TraceListener for pure XPath also?
>
> My gut reaction would be no... those are performance intense places and I
> would rather not add more feature bloat. But if you can make a
> really good
> case why it makes sense, I might consider.
>
> -scott
>
>
>
>
>
>
> "Mikko
>
> Honkala" To:
> <[EMAIL PROTECTED]>
> <[EMAIL PROTECTED] cc: (bcc: Scott
> Boag/CAM/Lotus)
> ut.fi> Subject: RE:
> Xalan-J: list of referenced DOM nodes for an XPath
> expression?
>
> 08/08/2001
>
> 08:44 AM
>
> Please respond
>
> to xalan-dev
>
>
>
>
>
>
>
>
>
> With a little hacking it seems that I can get the information about which
> nodes the XPath expression evaluates on from these 2 methods in
> org.apache.xpath.axes.LocPathIterator.java :
>
> public XObject execute(XPathContext xctxt) // for single nodes
> public DTMIterator asIterator(
> XPathContext xctxt, int contextNode) // for node sets
>
> The problem is that I have to modify Xalan's XPath source in order to send
> events from these 2 methods... Would it be sensible to define an Interface
> similar to XSLT's TraceListener for pure XPath also?
>
> - Mikko Honkala - http://www.x-smiles.org/
>
>
> > -----Original Message-----
> > From: Gary L Peskin [mailto:[EMAIL PROTECTED]]
> > Sent: 7. elokuuta 2001 19:07
> > To: [EMAIL PROTECTED]
> > Subject: Re: Xalan-J: list of referenced DOM nodes for an XPath
> > expression?
> >
> >
> > I'm not sure what you're getting at here, Mikko, but have a look at the
> > TraceListener interface. It gets fired whenever a node is selected.
> >
>
>
>
>
>