Fluent XML [3]
Few days ago I was answering some OmniXML related question on Slovenian Delphi forum and I tried using GpFluentXML to provide the answer. The emphasis is on “tried” – my unit was just not powerful enough to be useful in this case. So what else could I do besides improving GpFluentXML? Modifications were very small. I added two overloads (AddChild and AddSibling) which allow setting node value. Implementation is equally trivial as everything else inside the fluent XML unit. function TGpFluentXmlBuilder.AddChild(const name: XmlString; (And similar for AddSibling.) Now I (and you and everybody else) can write such code: var A non-obvious trick – .Mark and .Return are used inside the loop to store/restore proper level at which the child nodes must be inserted. Full GpFluentXML source is available at http://17slon.com/blogs/gabr/files/GpFluentXml.pas. Labels: Delphi, programming, source code, XML |
1 Comments:
I like it very much!
Thanks,
Ajasja
Post a Comment
Links to this post:
Create a Link
<< Home