1

我已经使用 BTAHL7V2X 模式(MSH_25_GLO_DEF 等)构建了一个程序集。

在另一个程序集中,我需要创建一个模式,其中一个元素的类型为 MSH_25_GLO_DEF。

在我的 BTAHL7V2XCommon 程序集中,我有:

<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://microsoft.com/HealthCare/HL7/2X" targetNamespace="http://microsoft.com/HealthCare/HL7/2X" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:appinfo>
      <b:schemaInfo root_reference="MSH_25_GLO_DEF" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="MSH_25_GLO_DEF">
  ...

在我的另一个程序集中,我有一个如下所示的架构:

<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://mycompany.com/Custom/HL7/2X" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:ns0="http://microsoft.com/HealthCare/HL7/2X" targetNamespace="http://mycompany.com/Custom/HL7/2X" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:import schemaLocation="BTAHL7Schemas.MSH_25_GLO_DEF" namespace="http://mycompany.com/Custom/HL7/2X"/>
  <xs:include schemaLocation="ORU_R01_23_GLO_DEF.xsd" />
  <xs:annotation>
    <xs:appinfo>
      <b:schemaInfo standards_version="HL7.DBVersion.1_5" document_type="HL7 2X Schema" version="2.0.0104.0.2.0" root_reference="ORU_R01_23_GLO_DEF" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" />
      <b:references>
        <b:reference targetNamespace="http://mycompany.com/Custom/HL7/2X/2.3/ORU/DataTypes" />
        <b:reference targetNamespace="http://microsoft.com/HealthCare/HL7/2X" />
        <b:reference targetNamespace="http://mycompany.com/Custom/HL7/2X/2.3/ORU/Segments" />
        <b:reference targetNamespace="http://mycompany.com/Custom/HL7/2X/2.3/ORU/Tables" />
      </b:references>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="ORU_R01_23_ALL">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="1" maxOccurs="1" name="MSH_25_GLO_DEF" type="ns0:MSH_25_GLO_DEF" />
        <xs:element minOccurs="1" maxOccurs="1" ref="ORU_R01_23_GLO_DEF" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

我添加了对包含 MSH 标头的 BTAHL7V2X 程序集的引用,如果我在对象浏览器中查看引用的程序集,我可以看到 MSH_25_GLO_DEF,但我总是收到一条错误消息“ http://microsoft.com/HealthCare/ HL7/2X:MSH_25_GLO_DEF未声明,当我查看我的架构时。

我还尝试将导入引用更改为包含:

<xs:include schemaLocation="BTAHL7Schemas.MSH_25_GLO_DEF" /> 

但在查看架构时会出现不同的错误:

The targetNamespace 'http://microsoft.com/HealthCare/HL7/2X' of included/redefined schema should be the same as the targetNamespace 'http://mycompany.com/Custom/HL7/2X' of the including schema. 

是否有在另一个程序集中引用 BizTalk 架构的正确方法?

4

1 回答 1

0

看看这个: http ://social.msdn.microsoft.com/Forums/en-US/biztalkgeneral/thread/d40d2c15-5c91-45c9-877d-2559802d1b1e

希望有帮助

<xs:schema ... targetNamespace="http://mycompany.com/Custom/HL7/2X">
        <xs:import schemaLocation="BTAHL7Schemas.MSH_25_GLO_DEF" namespace="http://microsoft.com/HealthCare/HL7/2X"/>
    <b:schemaInfo ... root_reference="ORU_R01_23_ALL" ... />
于 2013-03-18T19:51:03.730 回答