Delphi, XML Databinding wizard and “Interface not supported” error

After using Delphi 12 “XML Data Binding” with xsd file, I tried to load the XML file, but I got “Interface not supported” error.

This is the whole xsd file content:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.easa.europa.eu/erules-export" elementFormDefault="qualified"
xmlns="http://www.easa.europa.eu/erules-export">
<!--
EASA eRules XML Export 1.0.0 - Schema Definition
June 2022
-->
<xs:import namespace="http://schemas.microsoft.com/office/2006/xmlPackage"/>
<xs:element name="document" type="document-type"/>
<xs:complexType name="document-type">
<xs:sequence>
<xs:element name="frontmatter" type="frontback-type" minOccurs="0" maxOccurs="1"/>
<xs:element name="toc" type="toc-type" minOccurs="0" maxOccurs="1"/>
<xs:element name="backmatter" type="frontback-type" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attributeGroup ref="document-metadata"/>
<xs:attributeGroup ref="topic-metadata"/>
</xs:complexType>
<xs:complexType name="frontback-type">
<xs:attributeGroup ref="sdt"/>
</xs:complexType>
<xs:complexType name="toc-type">
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="toc" type="toc-type" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="heading" type="heading-type" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="topic" type="topic-type" minOccurs="0" maxOccurs="unbounded"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="topic-type">
<xs:attributeGroup ref="sdt"/>
<xs:attributeGroup ref="title"/>
<xs:attributeGroup ref="topic-metadata"/>
</xs:complexType>
<xs:complexType name="heading-type">
<xs:attributeGroup ref="sdt"/>
<xs:attribute name="title" type="xs:string"/>
</xs:complexType>
<xs:attributeGroup name="topic-metadata">
<xs:attribute name="ERulesId" type="xs:string"/>
<xs:attribute name="Domain" type="xs:string"/>
<xs:attribute name="ActivityType" type="xs:string"/>
<xs:attribute name="AircraftCategory" type="xs:string"/>
<xs:attribute name="AircraftUse" type="xs:string"/>
<xs:attribute name="AmendedBy" type="xs:string"/>
<xs:attribute name="ApplicabilityDate" type="xs:string"/>
<xs:attribute name="EntryIntoForceDate" type="xs:string"/>
<xs:attribute name="EquivalentForeignRegulation" type="xs:string"/>
<xs:attribute name="ICAOReference" type="xs:string"/>
<xs:attribute name="Keywords" type="xs:string"/>
<xs:attribute name="RegistryState" type="xs:string"/>
<xs:attribute name="RegulatedEntity" type="xs:string"/>
<xs:attribute name="RegulatorySource" type="xs:string"/>
<xs:attribute name="RegulatorySubject" type="xs:string"/>
<xs:attribute name="TechnicalSubjectMatter" type="xs:string"/>
<xs:attribute name="TypeOfContent" type="xs:string"/>
<xs:attribute name="ParentIR" type="xs:string"/>
<xs:attribute name="EASACategory" type="xs:string"/>
</xs:attributeGroup>
<xs:attributeGroup name="sdt">
<xs:attribute name="sdt-id" type="xs:string"/>
</xs:attributeGroup>
<xs:attributeGroup name="document-metadata">
<xs:attribute name="guid" type="xs:string"/>
<xs:attribute name="pub-time" type="xs:string"/>
<xs:attribute name="map-url" type="xs:string"/>
<xs:attribute name="pub-template-url" type="xs:string"/>
<xs:attribute name="xslt-url" type="xs:string"/>
<xs:attribute name="source-title" type="xs:string"/>
</xs:attributeGroup>
<xs:attributeGroup name="title">
<xs:attribute name="source-title" type="xs:string"/>
</xs:attributeGroup>
</xs:schema>
</code>
<code><?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.easa.europa.eu/erules-export" elementFormDefault="qualified" xmlns="http://www.easa.europa.eu/erules-export"> <!-- EASA eRules XML Export 1.0.0 - Schema Definition June 2022 --> <xs:import namespace="http://schemas.microsoft.com/office/2006/xmlPackage"/> <xs:element name="document" type="document-type"/> <xs:complexType name="document-type"> <xs:sequence> <xs:element name="frontmatter" type="frontback-type" minOccurs="0" maxOccurs="1"/> <xs:element name="toc" type="toc-type" minOccurs="0" maxOccurs="1"/> <xs:element name="backmatter" type="frontback-type" minOccurs="0" maxOccurs="1"/> </xs:sequence> <xs:attributeGroup ref="document-metadata"/> <xs:attributeGroup ref="topic-metadata"/> </xs:complexType> <xs:complexType name="frontback-type"> <xs:attributeGroup ref="sdt"/> </xs:complexType> <xs:complexType name="toc-type"> <xs:choice maxOccurs="unbounded" minOccurs="0"> <xs:element name="toc" type="toc-type" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="heading" type="heading-type" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="topic" type="topic-type" minOccurs="0" maxOccurs="unbounded"/> </xs:choice> </xs:complexType> <xs:complexType name="topic-type"> <xs:attributeGroup ref="sdt"/> <xs:attributeGroup ref="title"/> <xs:attributeGroup ref="topic-metadata"/> </xs:complexType> <xs:complexType name="heading-type"> <xs:attributeGroup ref="sdt"/> <xs:attribute name="title" type="xs:string"/> </xs:complexType> <xs:attributeGroup name="topic-metadata"> <xs:attribute name="ERulesId" type="xs:string"/> <xs:attribute name="Domain" type="xs:string"/> <xs:attribute name="ActivityType" type="xs:string"/> <xs:attribute name="AircraftCategory" type="xs:string"/> <xs:attribute name="AircraftUse" type="xs:string"/> <xs:attribute name="AmendedBy" type="xs:string"/> <xs:attribute name="ApplicabilityDate" type="xs:string"/> <xs:attribute name="EntryIntoForceDate" type="xs:string"/> <xs:attribute name="EquivalentForeignRegulation" type="xs:string"/> <xs:attribute name="ICAOReference" type="xs:string"/> <xs:attribute name="Keywords" type="xs:string"/> <xs:attribute name="RegistryState" type="xs:string"/> <xs:attribute name="RegulatedEntity" type="xs:string"/> <xs:attribute name="RegulatorySource" type="xs:string"/> <xs:attribute name="RegulatorySubject" type="xs:string"/> <xs:attribute name="TechnicalSubjectMatter" type="xs:string"/> <xs:attribute name="TypeOfContent" type="xs:string"/> <xs:attribute name="ParentIR" type="xs:string"/> <xs:attribute name="EASACategory" type="xs:string"/> </xs:attributeGroup> <xs:attributeGroup name="sdt"> <xs:attribute name="sdt-id" type="xs:string"/> </xs:attributeGroup> <xs:attributeGroup name="document-metadata"> <xs:attribute name="guid" type="xs:string"/> <xs:attribute name="pub-time" type="xs:string"/> <xs:attribute name="map-url" type="xs:string"/> <xs:attribute name="pub-template-url" type="xs:string"/> <xs:attribute name="xslt-url" type="xs:string"/> <xs:attribute name="source-title" type="xs:string"/> </xs:attributeGroup> <xs:attributeGroup name="title"> <xs:attribute name="source-title" type="xs:string"/> </xs:attributeGroup> </xs:schema> </code>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://www.easa.europa.eu/erules-export" elementFormDefault="qualified"
  xmlns="http://www.easa.europa.eu/erules-export">
  <!--
    EASA eRules XML Export 1.0.0 - Schema Definition
    June 2022
  -->
  <xs:import namespace="http://schemas.microsoft.com/office/2006/xmlPackage"/>
  <xs:element name="document" type="document-type"/>

  <xs:complexType name="document-type">
    <xs:sequence>
      <xs:element name="frontmatter" type="frontback-type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="toc" type="toc-type" minOccurs="0" maxOccurs="1"/>
      <xs:element name="backmatter" type="frontback-type" minOccurs="0" maxOccurs="1"/>
    </xs:sequence>
    <xs:attributeGroup ref="document-metadata"/>
    <xs:attributeGroup ref="topic-metadata"/>
  </xs:complexType>

  <xs:complexType name="frontback-type">
    <xs:attributeGroup ref="sdt"/>
  </xs:complexType>

  <xs:complexType name="toc-type">
    <xs:choice maxOccurs="unbounded" minOccurs="0">
      <xs:element name="toc" type="toc-type" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="heading" type="heading-type" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="topic" type="topic-type" minOccurs="0" maxOccurs="unbounded"/>      
    </xs:choice>
  </xs:complexType>

  <xs:complexType name="topic-type">
    <xs:attributeGroup ref="sdt"/>
    <xs:attributeGroup ref="title"/>
    <xs:attributeGroup ref="topic-metadata"/>
  </xs:complexType>

  <xs:complexType name="heading-type">
    <xs:attributeGroup ref="sdt"/>
    <xs:attribute name="title" type="xs:string"/>
  </xs:complexType>
  
  <xs:attributeGroup name="topic-metadata">
    <xs:attribute name="ERulesId" type="xs:string"/>
    <xs:attribute name="Domain" type="xs:string"/>
    <xs:attribute name="ActivityType" type="xs:string"/>
    <xs:attribute name="AircraftCategory" type="xs:string"/>
    <xs:attribute name="AircraftUse" type="xs:string"/>
    <xs:attribute name="AmendedBy" type="xs:string"/>
    <xs:attribute name="ApplicabilityDate" type="xs:string"/>
    <xs:attribute name="EntryIntoForceDate" type="xs:string"/>
    <xs:attribute name="EquivalentForeignRegulation" type="xs:string"/>
    <xs:attribute name="ICAOReference" type="xs:string"/>
    <xs:attribute name="Keywords" type="xs:string"/>
    <xs:attribute name="RegistryState" type="xs:string"/>
    <xs:attribute name="RegulatedEntity" type="xs:string"/>
    <xs:attribute name="RegulatorySource" type="xs:string"/>
    <xs:attribute name="RegulatorySubject" type="xs:string"/>
    <xs:attribute name="TechnicalSubjectMatter" type="xs:string"/>
    <xs:attribute name="TypeOfContent" type="xs:string"/>
    <xs:attribute name="ParentIR" type="xs:string"/>
    <xs:attribute name="EASACategory" type="xs:string"/>
  </xs:attributeGroup>

  <xs:attributeGroup name="sdt">
    <xs:attribute name="sdt-id" type="xs:string"/>
  </xs:attributeGroup>

  <xs:attributeGroup name="document-metadata">
    <xs:attribute name="guid" type="xs:string"/>
    <xs:attribute name="pub-time" type="xs:string"/>
    <xs:attribute name="map-url" type="xs:string"/>
    <xs:attribute name="pub-template-url" type="xs:string"/>
    <xs:attribute name="xslt-url" type="xs:string"/>
    <xs:attribute name="source-title" type="xs:string"/>
  </xs:attributeGroup>

  <xs:attributeGroup name="title">
    <xs:attribute name="source-title" type="xs:string"/>
  </xs:attributeGroup>

</xs:schema>

Here is the beginning of the XML file (link to whole XML):

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><?xml version="1.0" encoding="utf-8"?>
<?mso-application progid="Word.Document"?>
<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">
<pkg:part pkg:name="/customXml/item1.xml" pkg:contentType="application/xml">
<pkg:xmlData>
<CoverPageProperties xmlns="http://schemas.microsoft.com/office/2006/coverPageProps">
<PublishDate>2008</PublishDate>
<Abstract/>
<CompanyAddress/>
<CompanyPhone/>
<CompanyFax/>
<CompanyEmail/>
</CoverPageProperties>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/item2.xml" pkg:contentType="application/xml">
<pkg:xmlData>
<FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
<Display>DocumentLibraryForm</Display>
<Edit>DocumentLibraryForm</Edit>
<New>DocumentLibraryForm</New>
</FormTemplates>
</pkg:xmlData>
</pkg:part>
<pkg:part pkg:name="/customXml/item3.xml" pkg:contentType="application/xml">
<pkg:xmlData>
<Sources SelectedStyle="APA.XSL" StyleName="APA" xmlns="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography"/>
</pkg:xmlData>
</pkg:part>
</code>
<code><?xml version="1.0" encoding="utf-8"?> <?mso-application progid="Word.Document"?> <pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage"> <pkg:part pkg:name="/customXml/item1.xml" pkg:contentType="application/xml"> <pkg:xmlData> <CoverPageProperties xmlns="http://schemas.microsoft.com/office/2006/coverPageProps"> <PublishDate>2008</PublishDate> <Abstract/> <CompanyAddress/> <CompanyPhone/> <CompanyFax/> <CompanyEmail/> </CoverPageProperties> </pkg:xmlData> </pkg:part> <pkg:part pkg:name="/customXml/item2.xml" pkg:contentType="application/xml"> <pkg:xmlData> <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms"> <Display>DocumentLibraryForm</Display> <Edit>DocumentLibraryForm</Edit> <New>DocumentLibraryForm</New> </FormTemplates> </pkg:xmlData> </pkg:part> <pkg:part pkg:name="/customXml/item3.xml" pkg:contentType="application/xml"> <pkg:xmlData> <Sources SelectedStyle="APA.XSL" StyleName="APA" xmlns="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography"/> </pkg:xmlData> </pkg:part> </code>
<?xml version="1.0" encoding="utf-8"?>
<?mso-application progid="Word.Document"?>
<pkg:package xmlns:pkg="http://schemas.microsoft.com/office/2006/xmlPackage">
    <pkg:part pkg:name="/customXml/item1.xml" pkg:contentType="application/xml">
        <pkg:xmlData>
            <CoverPageProperties xmlns="http://schemas.microsoft.com/office/2006/coverPageProps">
                <PublishDate>2008</PublishDate>
                <Abstract/>
                <CompanyAddress/>
                <CompanyPhone/>
                <CompanyFax/>
                <CompanyEmail/>
            </CoverPageProperties>
        </pkg:xmlData>
    </pkg:part>
    <pkg:part pkg:name="/customXml/item2.xml" pkg:contentType="application/xml">
        <pkg:xmlData>
            <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
                <Display>DocumentLibraryForm</Display>
                <Edit>DocumentLibraryForm</Edit>
                <New>DocumentLibraryForm</New>
            </FormTemplates>
        </pkg:xmlData>
    </pkg:part>
    <pkg:part pkg:name="/customXml/item3.xml" pkg:contentType="application/xml">
        <pkg:xmlData>
            <Sources SelectedStyle="APA.XSL" StyleName="APA" xmlns="http://schemas.openxmlformats.org/officeDocument/2006/bibliography" xmlns:b="http://schemas.openxmlformats.org/officeDocument/2006/bibliography"/>
        </pkg:xmlData>
    </pkg:part>

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>{ Global Functions }
function Getdocument(Doc: IXMLDocument): IXMLDocumenttype;
begin
Result := Doc.GetDocBinding('document', TXMLDocumenttype, TargetNamespace) as IXMLDocumenttype;
end;
function Loaddocument(const FileName: string): IXMLDocumenttype;
begin
Result := LoadXMLDocument(FileName).GetDocBinding('document', TXMLDocumenttype, TargetNamespace) as IXMLDocumenttype;
end;
function Newdocument: IXMLDocumenttype;
begin
Result := NewXMLDocument.GetDocBinding('document', TXMLDocumenttype, TargetNamespace) as IXMLDocumenttype;
end;
</code>
<code>{ Global Functions } function Getdocument(Doc: IXMLDocument): IXMLDocumenttype; begin Result := Doc.GetDocBinding('document', TXMLDocumenttype, TargetNamespace) as IXMLDocumenttype; end; function Loaddocument(const FileName: string): IXMLDocumenttype; begin Result := LoadXMLDocument(FileName).GetDocBinding('document', TXMLDocumenttype, TargetNamespace) as IXMLDocumenttype; end; function Newdocument: IXMLDocumenttype; begin Result := NewXMLDocument.GetDocBinding('document', TXMLDocumenttype, TargetNamespace) as IXMLDocumenttype; end; </code>
{ Global Functions }

function Getdocument(Doc: IXMLDocument): IXMLDocumenttype;
begin
  Result := Doc.GetDocBinding('document', TXMLDocumenttype, TargetNamespace) as IXMLDocumenttype;
end;

function Loaddocument(const FileName: string): IXMLDocumenttype;
begin
  Result := LoadXMLDocument(FileName).GetDocBinding('document', TXMLDocumenttype, TargetNamespace) as IXMLDocumenttype;
end;

function Newdocument: IXMLDocumenttype;
begin
  Result := NewXMLDocument.GetDocBinding('document', TXMLDocumenttype, TargetNamespace) as IXMLDocumenttype;
end;

This is the way I try loading the file.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>function TXML_Reader_Main_Form.Read_XML( Const Fn:string): Boolean;
Var EASA_Doc: IXMLDocumenttype;
begin
Result:=False;
if NOT FileExists(SYS_Base_Folder+fn)
then Exit;
//
EASA_Doc:=Loaddocument(SYS_Base_Folder+fn);
//
// more code ....
end;
</code>
<code>function TXML_Reader_Main_Form.Read_XML( Const Fn:string): Boolean; Var EASA_Doc: IXMLDocumenttype; begin Result:=False; if NOT FileExists(SYS_Base_Folder+fn) then Exit; // EASA_Doc:=Loaddocument(SYS_Base_Folder+fn); // // more code .... end; </code>
function TXML_Reader_Main_Form.Read_XML( Const Fn:string): Boolean;
Var EASA_Doc: IXMLDocumenttype;
begin
     Result:=False;
     if NOT FileExists(SYS_Base_Folder+fn)
       then Exit;
     //
     EASA_Doc:=Loaddocument(SYS_Base_Folder+fn);
     //
     // more code ....
end;

“document” appears to be element name, but it fails.

I also tried “package”, “pkg” unsuccessfully.

What I am missing?

Thank you.

Giovanni

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật