Delphi Rio 10.3.1 Xml 数据绑定与重复的段名称

问题描述

我是 XML 处理和 Delphi 数据绑定向导的新手。

我正在尝试处理包含 2 个具有相同标识符名称内容不同的段的 XSD 并且我发现解析器根本就缺少第二段,将第二段的数据细节与第一段的数据细节混淆。第二部分的数据类型细节被处理成单元但与任何组件无关

这是我拥有的架构 并且两者都有一个名称相同但内容不同的子段。当我处理 detalhead1 时,我只在其中找到了与 infohead1 相关的 detailhead1 段,而不是与 detailhead1 相关的段。 Ide 中是否有选项可以让它正确地分隔段? 在向导使用期间,我可以选择单个架构组件并更改与数据类型关联的标识符名称。关键是在向导的那一部分中,我只找到了一种数据类型(detailhead1 出现在 infohead1 中),而不是两者

这是具有简化数据详细信息的架构示例 (我不是我可以更改它的架构的所有者/处理者)

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="datas.xsd"/>
    <xs:complextype name="Head1" minOccurs="0" maxOccurs="1">
        <xs:sequence>
            <xs:element name="Codeone" type="String6"/>
            <xs:element name="Datahead1">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="infohead1">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="head1field">
                                        <xs:complexType>
                                            <xs:element name="fieldONE" type="string2"/>
                                        </xs:complexType>
                                    </xs:element>
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                        <xs:element name="Detailhead1" minOccurs="0" maxOccurs="999">
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element name="head1field">
                                        <xs:complexType>
                                            <xs:element name="fieldTWO" type="string33"/>
                                        </xs:complexType>
                                    </xs:element>
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complextype>
</xs:schema>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)