我有一个 XSD 文件并将其加载到数据集中。显然,在 Dataset 中建立的 XSD 中嵌套元素之间的关系很好,但是在生成有关 XSD 的 XML 文件时,节点都出现在同一级别。
它应该如下所示:
DBMS
DATABASE
TABLE
我在调试模式下检查了数据集,所有数据关系都存在并且嵌套属性设置为 true。
XSD 文件:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:documentation>Created with EditiX (http://www.editix.com) at Thu Oct 31 21:35:29 EET 2013</xs:documentation>
</xs:annotation>
<xs:element name="dbms">
<xs:complexType>
<xs:sequence>
<xs:element name ="database" minOccurs="0" maxOccurs ="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name ="table" minOccurs ="0" maxOccurs ="unbounded">
<xs:complexType>
<xs:attribute name="name"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name ="name"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name ="name"></xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
XML 文件:
<MetaDataManagement>
<dbms name="mssql" />
<database name="master" />
<database name="tempdb" />
<database name="model" />
<database name="msdb" />
<database name="ReportServer" />
<database name="ReportServerTempDB" />
<database name="kutuphane" />
<table name="spt_fallback_db" />
<table name="spt_fallback_dev" />
<table name="spt_fallback_usg" />
<table name="spt_values" />
<table name="spt_monitor" />
<table name="MSreplication_options" />
<table name="sysmail_profile" />
<table name="syscollector_config_store_internal" />
<table name="sysutility_ucp_policy_check_conditions" />
<table name="sysutility_ucp_supported_object_types_internal" />
<table name="sysutility_ucp_policy_target_conditions" />
<table name="sysutility_ucp_policy_violations" />
<table name="sysutility_ucp_managed_instances_internal" />
<table name="sysmail_principalprofile" />
<table name="syscollector_config_store" />
<table name="sysutility_ucp_mi_health_internal" />
<table name="sysmaintplan_subplans" />
<table name="syspolicy_policy_category_subscriptions" />
<table name="sysdac_instances_internal" />
.....
</MetaDataManagement>