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.
Related
In Delphi XE2, there was an IDE feature which allowed me to create in-line XML code documentation (following Microsoft standards) in an editor window. It would describe each class, type, method, etc. in the interface section of a unit. However, in Delphi XE7, I cannot find it. I've done some searching, but as you can imagine, Delphi XE7 XML Code Documentation does not return the results I'm looking for.
In XE2, I remember the shortcut to toggle this window was either CTRL + SHIFT + D or CTRL + ALT + D. Neither of them do anything in XE7. I know I could manually write this myself, but that's a bit inconvenient. All I can find in the documentation is how to write the text yourself, and nothing about the editor window I was used to in XE2. I never installed any Delphi add-ons other than what came with Delphi itself (besides IDE Fix Pack).
Where can I find this feature in Delphi XE7 Enterprise? Or was it removed for some reason?
The feature you are describing is not directly implemented into Delphi but comes as third party addon that does integrate into Delphi. It is called Documentation Insight.
http://www.devjetsoftware.com/products/documentation-insight/
Documentation insight had come as free third party addon till Delphi XE6 when it was suposingly removed. Don't ask me why as I don't know.
So I'm afraid that you will have to buy this third party IDE extention now.
EDIT: Or you could use newest version of Delphi for development of your program and older version of Delphi like XE2 to generate documentation.
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.
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.
I have created my own XPath library for Delphi 2006 and have used it since. It works fine but could have more performance, and I don’t really have the time to maintain it any more.
What other library could I use?
OmniXML has good XML and XPath support, and it's free with source. Works with many versions of Delphi, too, including 2007 and 2009.
I import the MSXML library and use it directly. Works like a charm.
The Open XML, Alternative Document Object Model (ADOM) is also a great (and 100% Delphi) XML library including XPath support. It has DTD validation support, but unfortunately no XSD support.
http://www.philo.de/xml/downloads.shtml
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