Re: Accessing Transformiix library from C++

Allan Beaufour <[email protected]>
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Peter Van der Beken wrote:
> Allan Beaufour wrote:
>> Axel Hecht wrote:
>>> You can use DOM Level 3 XPath, esp nsIDOMXPathEvaluator, which is 
>>> implemented by html and xml documents. See that interface and its 
>>> friends over in mozilla/dom/public/idl/xpath
>>
>> I know. I am aware that I need to access it directly. I am already 
>> using the "normal" and exposed API for other things.
> 
> Why do you need the lexer specifically?

I need two things:
1) Get "dynamic function usage" in an expression

That is, find out whether and expression has any functions in it that 
would change the result from call to call, e.g. "now()".

2) Get all nodes that an expression depends on

That is all nodes that influences the expression, not the node set 
returned from an Evaluate(). I need to know that "thing[at=../other + 
../another]" depends on "../other" and "../another" (and "thing" of course).

The first one is fairly easy done with the lexer. The second one is more 
tricky, and could probably be done more easily done by instrumenting one 
or more evaluate()-functions?

> Sure, you could probably 
> manually load the library but that sounds like an ugly solution, so if 
> you let us know more about why/how you need the lexer, maybe we could 
> look for a better solution together.

No, I know that it wont win a beauty contest :) But I feel that it would 
be stupid not to take advantage of the existing code in the Mozilla 
tree, so I'm looking for a solution using Transformiix. So I would very 
much appreciate any help.

While we're at it: Another thing we need is to evaluate expressions 
where we can set contextSize and contextPosition. As far as I can see it 
is a question of changing/modifying the evaluation context? The problem 
is that I get kind of lost in the Transformiix code from time to time :)

... Allan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.