Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-09

Delphi compatible XML lib

6 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen gmail

Hi

What is the reason there is no Delphi compatible XML library in LCL? Otherwise Lazarus tries to be Delphi compatible.
There are many Delphi projects that can't be converted now because of this difference.
Maybe the converter can do automatic conversion for it in the future.

Juha

Reply by email

Michael Van Canneyt
to Juha Manninen gmail
Juha Manninen wrote
Hi What is the reason there is no Delphi compatible XML library in LCL?

Because there is no Delphi "XML library". Delphi provides a small wrapper around MSXML (or some other libraries, I think openxml also works).

FPC is designed to be portable, and therefor this solution (relying on system specific third-party libs) is not an option.

FPC contains a 100% native XML library that conforms to the DOM standards, and which works very well since many years.

It should not be hard to create a Delphi-compatible layer on top of it, but honestly: I don't see why you would want to do that...

Michael.

Reply by email

Juha Manninen gmail
to Michael Van Canneyt: Because there is no Delphi "XML library". Delphi provides a small wrapper around MSXML…
Michael Van Canneyt wrote
It should not be hard to create a Delphi-compatible layer on top of it, but honestly: I don't see why you would want to do that...

I am thinking how to improve the Delphi converter. Some projects fail in conversion only because they use XML and the library interface is different.

The converter could change the code directly or use some compatibility layer. The latter would even allow using the same source code for both Delphi and Lazarus.

Regards,
Juha

Reply by email

Sergei Gorelkin
to Juha Manninen gmail

Juha Manninen (gmail) ?????:

Show quoted text 11 lines
On Sunday 26 September 2010 18:30:10 Michael Van Canneyt wrote: > It should not be hard to create a Delphi-compatible layer on top of it, > but honestly: I don't see why you would want to do that... I am thinking how to improve the Delphi converter. Some projects fail in conversion only because they use XML and the library interface is different. The converter could change the code directly or use some compatibility layer. The latter would even allow using the same source code for both Delphi and Lazarus.

FCL dom.pp unit and Delphi xmldom.pas have a large common part which differ only in type name prefixes (TDOMNode <-> IDOMNode and so on).
Have a look at the WST project: it uses both libraries with a very small amount of glue code.

Regards,
Sergei

Reply by email

Michael Van Canneyt
to Juha Manninen gmail: I am thinking how to improve the Delphi converter. Some projects fail in conversion only…
Juha Manninen wrote 6 lines
On Sunday 26 September 2010 18:30:10 Michael Van Canneyt wrote: > It should not be hard to create a Delphi-compatible layer on top of it, > but honestly: I don't see why you would want to do that... I am thinking how to improve the Delphi converter. Some projects fail in conversion only because they use XML and the library interface is different.

I think that this will prove to be a minor point in most real-world apps :)

The converter could change the code directly or use some compatibility layer. The latter would even allow using the same source code for both Delphi and Lazarus.

But would be slower, plus then we create the expectation that the code will behave 100% as the delphi code, which is definitely never going to be the case, because the error exceptions and whatnot are different.

So I think it's better to change the code directly as much as possible, and point out to the user the discrepancies and let him handle them.

Michael.

Reply by email