1
votes

I want to create a Android program in Delphi XE5 to work with XML files. I use TXMLDocument.

I can't compile and run it, though, because Delphi repeatedly adds Xml.Win.msxmldom in the uses section. The following error occurs:

[DCC Fatal Error] Unit1.pas(11): F1026 File not found: 'C:\Users\HamiD\Documents\RAD Studio\Projects\Xml.Win.msxmldom.dcu' (unit scope "Xml.Win" indicates Win32, Win64 only)

How do I avoid using that unit in my project?

1
Having <b>MS</b>XML on Android would be... eh... surprising.Free Consulting

1 Answers

5
votes

In the TXMLDocument, change the DOM vendor from MSXML to ADOMXML v4, to stop the need to use the MSXML unit.

This is covered in the documentation for TXMLDocument.DOMVendor. Although it mentions specifically Mac, the same applies to other FireMonkey applications on iOS and Android.

Tip: If you are designing a FireMonkey application that is intended to run on Mac OS X, then you should perform the following steps to ensure that the compilation succeeds:

Change DOMVendor from MSXML to ADOM XML v4.

If the Xml.Win.msxmldom unit is in the uses clause then remove it.

Compile your application for Mac OS X.

The documentation was modified in the XE5 version to read instead:

Tip: To use TXMLDocument in Mac OS X or Mobile applications, in the Object Inspector, set the DOMVendor property to ADOM XML v4 right after dropping this component onto the Form Designer. Otherwise, the TXMLDocument component is no longer usable for iOS/Android/OSX applications.