* * *

Author Topic: Which component to use to handle XML files?  (Read 2039 times)

laguna

  • Full Member
  • ***
  • Posts: 221
Which component to use to handle XML files?
« on: June 07, 2017, 01:03:25 pm »
Can you suggest a component to use to handle XML files?

Regards
Vincenzo

Zoran

  • Hero Member
  • *****
  • Posts: 1148
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Which component to use to handle XML files?
« Reply #1 on: June 07, 2017, 01:30:25 pm »
Can 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

  • Hero Member
  • *****
  • Posts: 4505
Re: Which component to use to handle XML files?
« Reply #2 on: June 07, 2017, 03:50:54 pm »
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)
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

Zoran

  • Hero Member
  • *****
  • Posts: 1148
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Which component to use to handle XML files?
« Reply #3 on: June 07, 2017, 06:43:31 pm »
The tutorial is good but not complete,

Heh, the tutorial is not only good, but also the only one we currently have. ;)

, 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

  • Hero Member
  • *****
  • Posts: 1118
    • Additional info
Re: Which component to use to handle XML files?
« Reply #4 on: June 07, 2017, 06:54:24 pm »
Can you suggest a component to use to handle XML files?
https://github.com/mremec/omnixml
ct2laz - Easily convert components and projects between Lazarus and CodeTyphon

Thaddy

  • Hero Member
  • *****
  • Posts: 4505
Re: Which component to use to handle XML files?
« Reply #5 on: June 07, 2017, 08:56:44 pm »
The tutorial is good but not complete,

Heh, the tutorial is not only good, but also the only one we currently have. ;)

, 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....

« Last Edit: June 07, 2017, 09:00:19 pm by Thaddy »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

laguna

  • Full Member
  • ***
  • Posts: 221
Re: Which component to use to handle XML files?
« Reply #6 on: June 08, 2017, 08:43:39 am »
Thanks all,
Used omniXML, is very good.

Help me, this error in test demo app. (SetAnsiStrProp)

Regards


avra

  • Hero Member
  • *****
  • Posts: 1118
    • Additional info
Re: Which component to use to handle XML files?
« Reply #7 on: June 08, 2017, 03:56:40 pm »
Used 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
ct2laz - Easily convert components and projects between Lazarus and CodeTyphon

Zoran

  • Hero Member
  • *****
  • Posts: 1148
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Which component to use to handle XML files?
« Reply #8 on: June 08, 2017, 08:19:42 pm »
SAX 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

  • Full Member
  • ***
  • Posts: 221
Re: Which component to use to handle XML files?
« Reply #9 on: June 09, 2017, 11:29:06 am »
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

Used 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

  • Hero Member
  • *****
  • Posts: 4505
Re: Which component to use to handle XML files?
« Reply #10 on: June 09, 2017, 12:39:58 pm »
Using 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. <grumpy mode  >:D>
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... :P :) O:-) 8-)
« Last Edit: June 09, 2017, 12:42:24 pm by Thaddy »
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

avra

  • Hero Member
  • *****
  • Posts: 1118
    • Additional info
Re: Which component to use to handle XML files?
« Reply #11 on: June 09, 2017, 01:32:56 pm »
Could 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
ct2laz - Easily convert components and projects between Lazarus and CodeTyphon

Thaddy

  • Hero Member
  • *****
  • Posts: 4505
Re: Which component to use to handle XML files?
« Reply #12 on: June 09, 2017, 02:07:44 pm »
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..
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

avra

  • Hero Member
  • *****
  • Posts: 1118
    • Additional info
Re: Which component to use to handle XML files?
« Reply #13 on: June 09, 2017, 02:27:53 pm »
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..
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.
ct2laz - Easily convert components and projects between Lazarus and CodeTyphon

Thaddy

  • Hero Member
  • *****
  • Posts: 4505
Re: Which component to use to handle XML files?
« Reply #14 on: June 09, 2017, 02:31:06 pm »
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. O:-)
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus