12.03.2014 21:46, Daniel Gaspary пишет:
On Wed, Mar 12, 2014 at 2:36 PM, Michael Van Canneyt
<mich...@freepascal.org> wrote:
What can be achieved at the most seems to be the parsing of the expression
and the resulting parse tree.

Is exactly what I'm trying to say(my lack of English grammar skills
doesn't help). :)

I seriously doubt this is doable, since XPath works directly on the DOM tree
?

Is possible if TXmlReader keeps track of the it's current path. Let's say:

TMyXmlReader = class(TXmlTextReader)
private
          FPath: TStrings; //or another dedicated new CLass to keep a
list of nodes.
public
         Register(XPathExpression: string; MethodToCall);
end;

At each step of processing, FPath is updated and is compared to XPathExpression.

A certain subset of expressions (forward iteration only) can be handled that 
way, yes.
But in general, XPath requires a source with non-sequential access.

Regards,
Sergei
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to