Which component to use to handle XML files? lazarus / 62-General ---------------------------------------------------------------------- laguna · 2017-06-07 11:03 Can you suggest a component to use to handle XML files? Regards Vincenzo ---------------------------------------------------------------------- Zoran · 2017-06-07 11:30 Quote from: laguna on June 07, 2017, 01:03:25 pmCan you suggest a component to use to handle XML files? Regards Vincenzo Not the component, but FPC has the classes for manipulating XML. See the tutorial on wiki: http://wiki.freepascal.org/XML_Tutorial ---------------------------------------------------------------------- Thaddy · 2017-06-07 13:50 The tutorial is good but not complete, besides DOM also SAX is supported out-of-the-box by FreePascal (and much faster in certain scenarios) ---------------------------------------------------------------------- Zoran · 2017-06-07 16:43 Quote from: Thaddy on June 07, 2017, 03:50:54 pmThe tutorial is good but not complete, Heh, the tutorial is not only good, but also the only one we currently have. Quote from: Thaddy on June 07, 2017, 03:50:54 pm, besides DOM also SAX is supported out-of-the-box by FreePascal (and much faster in certain scenarios) Nice to have this SAX (which seems to be acronym of Simpe API for XML), but... if not documented at all... not very useful. Perhaps Vicenzo will improve the tutorial, after he masters SAX with FPC. ---------------------------------------------------------------------- avra · 2017-06-07 16:54 Quote from: laguna on June 07, 2017, 01:03:25 pmCan you suggest a component to use to handle XML files?https://github.com/mremec/omnixml ---------------------------------------------------------------------- Thaddy · 2017-06-07 18:56 Quote from: Zoran on June 07, 2017, 06:43:31 pmQuote from: Thaddy on June 07, 2017, 03:50:54 pmThe tutorial is good but not complete, Heh, the tutorial is not only good, but also the only one we currently have. Quote from: Thaddy on June 07, 2017, 03:50:54 pm, besides DOM also SAX is supported out-of-the-box by FreePascal (and much faster in certain scenarios) Nice to have this SAX (which seems to be acronym of Simpe API for XML), but... if not documented at all... not very useful. Perhaps Vicenzo will improve the tutorial, after he masters SAX with FPC. SAX is a standard and as such widely documented.... Just like dom is a standard.... ---------------------------------------------------------------------- laguna · 2017-06-08 06:43 Thanks all, Used omniXML, is very good. Help me, this error in test demo app. (SetAnsiStrProp) Regards ---------------------------------------------------------------------- avra · 2017-06-08 13:56 Quote from: laguna on June 08, 2017, 08:43:39 amUsed omniXML, is very good. Help me, this error in test demo app. (SetAnsiStrProp) Sorry, I do not get what is the error from your screenshot. Do you have error message? Anyway, I have converted 7 Delphi demos to Lazarus and added one new demo for OmniXML fork called kOmniXML. You can find the link here and tell us all if these demos work with omniXML: https://forum.lazarus.freepascal.org/index.php?topic=22550.0 ---------------------------------------------------------------------- Zoran · 2017-06-08 18:19 Quote from: Thaddy on June 07, 2017, 08:56:44 pmSAX is a standard and as such widely documented.... Just like dom is a standard.... Using it in FPC is not documented, unlike DOM. Or I couldn't find it. ---------------------------------------------------------------------- laguna · 2017-06-09 09:29 Could it be that I downloaded the wrong version of OMNIXML? After downloading the demos, which you reported to me for Lazarus. Compile the first project by arranging the path, and here's the first error: Thanks Quote from: avra on June 08, 2017, 03:56:40 pmQuote from: laguna on June 08, 2017, 08:43:39 amUsed omniXML, is very good. Help me, this error in test demo app. (SetAnsiStrProp) Sorry, I do not get what is the error from your screenshot. Do you have error message? Anyway, I have converted 7 Delphi demos to Lazarus and added one new demo for OmniXML fork called kOmniXML. You can find the link here and tell us all if these demos work with omniXML: https://forum.lazarus.freepascal.org/index.php?topic=22550.0 ---------------------------------------------------------------------- Thaddy · 2017-06-09 10:39 Quote from: Zoran on June 08, 2017, 08:19:42 pmUsing it in FPC is not documented, unlike DOM. Or I couldn't find it. God, any god will do - or gods-, please help protect the innocents from the brave. If you are silly enough to use XML, please be capable enough to use it. Either SAX (streaming) or DOM (random access). Today you sound like Theresa May... Or the Donald. We have enough programmers to shoot themselves in the foot. Go into politics... ---------------------------------------------------------------------- avra · 2017-06-09 11:32 Quote from: laguna on June 09, 2017, 11:29:06 amCould it be that I downloaded the wrong version of OMNIXML?Sorry, it seams that I wrongly hoped that demos I made for kOmniXML (fork of OmniXML) will also work in original OmniXML. You can either try to adapt them, or use kOmniXML (abandoned by author!) from here: http://www.kluug.net/omnixml.php ---------------------------------------------------------------------- Thaddy · 2017-06-09 12:07 Avra plz advice first the included - and superior - XML solutions in FPC and only when needed third party stuff. You put people on the wrong track and it is hard to give advice on exotic (or toxic) solutions.. ---------------------------------------------------------------------- avra · 2017-06-09 12:27 Quote from: Thaddy on June 09, 2017, 02:07:44 pmAvra plz advice first the included - and superior - XML solutions in FPC and only when needed third party stuff. You put people on the wrong track and it is hard to give advice on exotic (or toxic) solutions.. I am sorry that you feel this way. Others have already promoted built in XML solutions before I made a suggestion, so I didn't feel a need to mention it. I liked kOmniXML much before it became abandoned, since it's easy to work with and it was the only lib with XPath I could find to work on both Delphi and Lazarus. I take the full blame for suggesting that my conversion of kOmniXML examples could work on original OmniXML out of the box. That was naive of me and I do apologize. ---------------------------------------------------------------------- Thaddy · 2017-06-09 12:31 OmniXML is great. I used it. I just tried to make the point that the native XML support is already very good. I Apologize - in this case - if you feel in anyway offended. ---------------------------------------------------------------------- Zoran · 2017-06-09 12:32 Quote from: Thaddy on June 09, 2017, 12:39:58 pmQuote from: Zoran on June 08, 2017, 08:19:42 pmUsing it in FPC is not documented, unlike DOM. Or I couldn't find it. God, any god will do - or gods-, please help protect the innocents from the brave. If you are silly enough to use XML, please be capable enough to use it. Either SAX (streaming) or DOM (random access). Today you sound like Theresa May... Or the Donald. We have enough programmers to shoot themselves in the foot. Go into politics... Thaddy, wasn't it you who first posted in this topic that the tutorial is incomplete? And didn't you also say why it's incomplete -- because it does not document SAX usage in FPC. I don't see how else could we, the mortals (yes your favourite politicians included), interpret your words, when you said just that: Quote from: Thaddy on June 07, 2017, 03:50:54 pmThe tutorial is good but not complete, besides DOM also SAX is supported out-of-the-box by FreePascal (and much faster in certain scenarios) But your gods might interpret it differently and protect the innocent you.