提问人:Ariox66 提问时间:1/31/2023 更新时间:1/31/2023 访问量:78
在 SQL Server 中使用 XSD 结构文件生成 XML 输出
Generating XML output using XSD structure file in SQL Server
问:
我有一个非常复杂的 XSD 结构文件,它应该帮助我们在 XML 中生成报告,但是 XSD 很容易更改,并且必须不断更新基本代码。不知道有没有办法使用xsd文件本身生成XML输出?
XSD 有很多嵌套字段
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://-" " elementFormDefault="qualified" attributeFormDefault="unqualified" version="6-2">
<xs:include schemaLocation="--"/>
<xs:complexType name="Address_Structure">
<xs:choice>
<xs:element name="UnstructuredAddress" type="ns:UnstructuredAddress_Type"/>
<xs:element name="StructuredAddress" type="ns:StructuredAddress_Type" minOccurs="2" maxOccurs="5"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="ClinicalActivity_AE_Structure">
<xs:sequence>
<xs:element name="ClinicalActivityGroupOPCS" type="ns:ClinicalActivityGroupOPCS_Type" minOccurs="0"/>
<xs:element name="ClinicalActivityGroupREAD" type="ns:ClinicalActivityGroupREAD_Type" minOccurs="0"/>
<xs:element name="ClinicalTreatmentGroupAandE" type="ns:ClinicalTreatmentGroupAAndE_Type" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ClinicalActivity_Structure">
<xs:sequence>
<xs:element name="ClinicalActivityGroupOPCS" type="ns:ClinicalActivityGroupOPCS_Type" minOccurs="0"/>
<xs:element name="ClinicalActivityGroupREAD" type="ns:ClinicalActivityGroupREAD_Type" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ClinicalActivityGroupOPCS_Type">
<xs:sequence>
<xs:element name="ProcedureSchemeInUse" type="ns:ProcedureSchemeInUse_Type"/>
<xs:element name="PrimaryProcedureGroupOPCS">
<xs:complexType mixed="false">
<xs:sequence>
<xs:element name="PrimaryProcedure_OPCS" type="ns:PrimaryProcedure_OPCS_Type"/>
<xs:element name="ProcedureDate" type="ns:ProcedureDate_Type" minOccurs="0"/>
<xs:element name="MainOperatingHCP" type="ns:ProfessionalsInvolved_Structure" minOccurs="0"/>
<xs:element name="ResponsibleAnaesthetist" type="ns:ProfessionalsInvolved_Structure" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SecondaryProcedureGroupOPCS" minOccurs="0" maxOccurs="unbounded">
<xs:complexType mixed="false">
<xs:sequence>
<xs:element name="SecondaryProcedure_OPCS" type="ns:Procedure_OPCS_Type"/>
<xs:element name="ProcedureDate" type="ns:ProcedureDate_Type" minOccurs="0"/>
<xs:element name="MainOperatingHCP" type="ns:ProfessionalsInvolved_Structure" minOccurs="0"/>
<xs:element name="ResponsibleAnaesthetist" type="ns:ProfessionalsInvolved_Structure" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
答: 暂无答案
评论