W3C home > Mailing lists > Public > www-svg@w3.org > March 2004

Re: 4 Rendering Custom Content

From: Robin Berjon <robin.berjon@expway.fr>
Date: Wed, 10 Mar 2004 16:03:36 +0100
Message-ID: <404F2E48.6090107@expway.fr>
To: Cameron McCormack <cam-www-svg@aka.mcc.id.au>
Cc: www-svg@w3.org

Cameron McCormack wrote:
>>It is one thing to have XPath evaluator and it is a different thing to
>>have XPath dependency tracker, right? How hard is such tracker, based
>>from your experience? I thought that it is fairly hard, but if it is
>>not maybe we need such thing. It would help in #8 as well.
> 
> It's not terribly difficult.  My algorithm involved stepping through the
> XPath ignoring any square bracket predicates.

Ignoring the predicates means you're missing a lot of dependencies, but 
then I'm not sure that's what you're doing since you mention handling 
them later on. If you do, do you handle position testing?

> So we start with the current node (in my case, the element whose
> attribute this XPath is describing).  Then recursively for each step:
> 
>   - if it's an id() function call, add a deep attribute dependency on
>     the document element for "id" attributes.  If we're not currently
>     inside a predicate, evaluate the id() function call and for each
>     node in the resulting nodeset, recurse.

How does this interact with DOM 3 Element::setIdAttribute and friends?

http://www.w3.org/TR/2004/PR-DOM-Level-3-Core-20040205/core.html#ID-ElSetIdAttr

> Currently I ignore the namespace, following and preceding axes.  In my
> CSVG project I have other dependencies that are set up when extension
> functions are called, e.g. for bounding boxes.

Does that not imply that for any added extension function one may also 
need to write special dependency handling code?

What happens to generate-id()? Since it's not guaranteed to produce the 
same result in two runs, does it work for a re-run if another part of 
the tree refers to it?

> It will be interesting to see if I can implement the XPath dependency
> analysis, constraint propagation and evaluation in plain SVG 1.1.
> Anyone know of an existing ECMAScript XPath evaluator or XPath to DOM
> calls compiler?

It's quite doable, apart from not having access to file and other such 
limitations (which are library limitations) there's nothing you can do 
in Java that you can't do in EcmaScript. There's an ActionScript XPath 
evaluator as part of DENG (now Open Sourced). Otherwise porting one 
wouldn't be hard. It'll be slow though.

-- 
Robin Berjon
Received on Wednesday, 10 March 2004 10:04:08 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:26 GMT