[fpc-devel] XML / SAX - Removing redundancies

Daniel Gaspary dgaspary at gmail.com
Wed Mar 12 18:46:17 CET 2014


On Wed, Mar 12, 2014 at 2:36 PM, Michael Van Canneyt
<michael at 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.



More information about the fpc-devel mailing list