What is the best (easy to use, performances) library to manage XML on Delphi XE2. Windows and Mac targets in mind.
I usually go for the NativeXML library, it's an XML library completely written in Delphi code and it's free. I'm not sure if the latest version offers compatibility with the Firemonkey platform, but with a few changes to unit names I tested it successfully back when Delphi XE2 was first released.
You can find the component here: http://www.simdesign.nl/xml.html
In case the latest version isn't compatible with XE2 yet, there's a topic on the forums about how to make it compatible: http://www.simdesign.nl/forum/viewtopic.php?t=2110
You can use OmniXML, it is:
100% written in delphi
Has no outer dependencies
Works on XE2, did not test it on OSX
On top of OmniXML you can use SimpleStorage to give you more power and simplicity managing the XML.
Andreano Lanusse has a nice blog post on using XML on Mac. It turns out that:
When you drop a TXMLDocument component on your design the default DOMVendor MSXML, you have to change to ADOM XML v4 to support cross-platform.
Related
Recently we upgraded our code from Delphi 2009 to Delphi XE and updated our Indy components (not sure if this is relevant).
But ever since then we have had errors on Windows Server 2003 machines when loading and saving XML files.
XMLDoc.LoadFromFile()
XMLDoc.SaveToFile()
The DLL msvcrt.dll is much smaller on Windows Server 2003 (300kb or so) compared to over 600kb on other operating systems... So its missing something in that file and its causing the error...
Does anyone know how to fix this? Or is there an alternative to TXMLDocument that I can try?
By default, TXMLDocument/IXMLDocument is just a wrapper around the MSXML COM interfaces when running on Windows platforms. Neither TXMLDocument nor Indy use the _ftol2_sse() function, or even link to msvcrt.dll. Something else in your project is at fault.
msvcrt.dll is (part of) the Microsoft Visual C++ Runtime. I think you got an older (or maybe even newer) version of this runtime that doesn't include this function.
Now you'll have to find out where this function is called. Do you link obj files with your project or use (other) 3rd party dll's?
To answer the last part ("is there an alternative?"), you might want to check out Jedi Code Library's TJclSimpleXML class. It does not require any external DLL, is quite fast, and is very easy to use. Besides, these days JCL and JVCL are a must-have anyway if you code in Delphi.
http://wiki.delphi-jedi.org/wiki/JEDI_Code_Library is their page I believe. I hear in seattle you can get it through IDEs integrated package manager.
Why isn't anyone developing QT bindings for Delphi.
In the past we had QT 2.x integrated as CLX in Delphi.
I really hate the CLX wrappers since they were buggy and hard to extend.
But why isn't anyone making an API list of external DLL calls to use (the same way JCL wraps the Windows API).
Is it so hard to code such API function mapping? Or maybe the QT classes cannot be exposed to non-C callers?
Any hint in this direction is welcome.
qtintf.dll seems to be the flat API DLL you're looking for and Qt.pas the corresponding import unit.
I recommend you wait for VCL+, that is the Qt binding coming with the next version of Delphi.
The problem is that Qt is heavily macro-based and C++ based. So the Qt "flat API" is quite verbose and big. I wonder how EMB will create its own VCL+ binding, but I'll definitively wait for their implementation for using Qt on any Delphi project.
If you can't wait, and really want cross-platform User Interface (with Mac O$ support), I recommend using http://www.twinforms.com/products/wxformsdelphi and not Qt. It relies on a separate DLL, but it's easier to develop, and well maintained/documented.
I managed to port the qt4.pas from
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html.
It is originally written for Lazarus but I managed to port it to Delphi.
One must do the following
declare
type
PUInt = ^Integer;
PTRUINT = PUInt;
PtrInt = ^Integer;
PPtrInt = ^PtrInt;
comment out all calls with "qword" paramters since quad-words are not supported in Delphi
comment out "{$mode objfpc}{$H+}" since this is Lazarus stuff
replace all "cdecl; external" with "cdecl; overload; external"
Than the demos can be compiled and run just fine with Delphi.
From what I've heard, apparently the cross-platform component library for Delphi XE2 (version due out next year) will be QT based, sorta like CLX only it should actually work right.
I started occupational programming with Delphi when the Turbos came out , and have licenses for Delphi 2006 Turbo Pro and Delphi 2009 Professional. I have been asked to support another in-house tool, written by another occupational programmer, who has since retired.
It's a Windows program, but it was developed with Delphi 6 using the CLX library rather than the VCL.
From what I gather, the CLX library was QT based and was removed prior to Delphi 2006.The support only consists of a few bug fixes and some minor tweaks, so I would rather not port the code to VCL, if i can avoid it.
Is it possible to install CLX support into either Delphi 2006 or 2009?
Maybe not a direct answer but if you upgrade to Delphi XE, you will also get license keys for some of the older versions of Delphi down to 7, and Delphi 7 included CLX (it was dropped in Borland Delphi 2006).
The short answer is: no. Unfortunately I don't know any long answer which could tell you how to workaround this.
No, you can't add support for CLX to your other Delphi versions.
If it's in-house software, then your company should still have the in-house Delphi installation used to develop it. Multiple Delphi versions can co-exist on the same system; install earlier versions before installing later versions.
If the former employee took that installation with him when he left, can you get it back? I wouldn't expect it really belongs to him anyway. You said he retired; that wasn't a euphemism for died, was it? If not, then you can still contact him.
If there isn't an easy way (and I suspect that there is not), you may need to continue using D7. D2009 is going to introduce the hassle of Unicode, and even going to D2006 is going to cause problems with 3rd-party libraries.
You could run both versions of Delphi on the same machine, but another option would be to use a VM for the legacy development. Either set up a new instance, or you could use the VMWare Converter to convert the other developer's entire machine into a VM image, which you could run on your machine, via the free VMWare Player.
BTW, VMWare Converter is a GREAT way to preserve old environments, to allow maintenance on older software that really needs to use a particular Delphi version, on a particular OS, "just like I left it". If you have a bunch of dusty computers under your desk, consider this option. VMWare Converter is the only tool I know of that will easily convert a physical machine to a useable VM that will run anywhere.
I'm migrating my Delphi 7 app to Delphi 2010. We used the Open XML (from http://www.philo.de/).
In Delphi 2010 it seems to be already built in. In the documentation it says so (ms-help://embarcadero.rs2010/rad/Using_the_Document_Object_Model.html)
"and the unit for the Open XML implementation is OXMLDOM"
But I can not find any OXMLDOM in my installation.
Am I missing something? Or the OpenXML support was dropped?
Daniel
It looks like that changed. The vendors I see support for are MSXML, Xerces, and ADOM v4.
You can still use Open XML; just create the XML document yourself instead of dragging TXMLDocument on to a form. I use OmniXML for most of the stuff I do, and it works fine in D2007, D2009, and D2010.
Are there any utilities that reformat Delphi code ?
EDIT
I am using Delphi 2006
Some feedback
Thanks to all that answered this question
I have been using the JCF code formatter - it works well and my code is been formated to Object Pascal Style Guide
You can try the "Jedi code Format". See more information here: http://jedicodeformat.sourceforge.net/
The formatting engine of DelForExp has been integrated into the code base of GExperts. An experimental version of GExperts including a "Code formatter" here:
http://blog.dummzeuch.de/experimental-gexperts-version/
Separate information/downloads for DelForExp here.
Regards.
I have been for some time releasing experimental GExperts versions that include the code formatter formerly known as DelForEx with some improvements and fixes. The latest release is from 2020-10-23 and supports the following Delphi versions:
Delphi 6 to 7
Delphi 2005 to 2010
Delphi XE
Delphi XE2 to XE8
Delphi 10 to 10.4
Delphi 11 (Danger, Alpha version for now 2021-10-24)
Please note, though, that I am using it only with Delphi 2007, so the other versions may have unknown bugs. Also, not all language improvements of later Delphi versions will work, e.g. nested types, generics and anonymous methods.
see gexperts.dummzeuch.de for details.
btw: Any help improving the formatter, especially adding the new language constructs would be appreciated. The source code can be downloaded from the subversion repository linked from my homepage.
I found this: JEDI Code Format
lextudio - Code Beautifier Collection 6 for CodeGear RAD Studio 2007
http://code.google.com/p/lextudio/
Yes,
I always used TWM's experimental version os GExperts which support this feature.
In Delphi 2006 and 2007 it works perfectly (Don't know about older versions though).
The current version is adding support to Delphi 2009, but I don't know in which stage it is, you can find more about it here:
http://www.dummzeuch.de/delphi/gexperts/english.html
BTW: There is an integrated Source Code Formatter since Delphi 2010.
Free Pascal also has a codeformatter, ptop, but it only implements the more basic dialect (say D4-D6 level).
Lazarus recently changed to use the Jedi codeformatter afaik.
The TWM version of GExperts works well and is nicely integrated into the IDE. It enables you to write and modify your code without worrying too much about exact formatting, then just hit the assigned hot-key and it instantly reformats. I have always found it easy to set up to match the style I prefer, and not as complex as JEDI Code Format, which looked like overkill to me.
The Delphi 2009 version is now available from the link posted above, though based on a beta release of GExperts. It is still much the same formatter underneath, though, and is unaware of the syntax of some of the newer Delphi enhancements.
I just made an online pascal code beautifier based on JCF. You may try it at https://pak.lebah.web.id/jcf
HTH.
There is OPEdit II which is free, and works very well.
It's a full text editor, with code refactoring and code browsing.
There is a text formatter, which uses the internal code parser, therefore handle conditional defines just as a real Delphi compiler.
See http://www.codefactor2.com
There is a program PascalFormat