[Lazarus] Read/write records from/to XML

Anthony Walter sysrpl at gmail.com
Sun Jan 11 19:53:32 CET 2015


Have you considered xpath? It's a core feature of all xml engines (msxml,
libxml2, whatever else).

Syntax overview:

http://msdn.microsoft.com/en-us/library/ms256086(v=vs.110).aspx

In my wrapper would look like this:

Person := Document.FindNode('//Person[@Index = "0001"]');

Other examples

// All persons in a city that start with the letter A
  Document.FindNodes('//Person[starts-with(City, "A")]');
// Or to processing save time, select the Persons node
  People := Document.FindNode('//Persons');
// And now xpath is evaluated relative to that
  People.FindNode('Person[Name = "Jan"]');

And so on
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150111/e4819232/attachment-0003.html>


More information about the Lazarus mailing list