2013-03-13 55 views
1

引用MSH_25_GLO_DEF模式我已經建立了與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> 

我已經加入到其中包含BTAHL7V2X集的引用在MSH頭,我可以看到MSH_25_GLO_DEF如果我查看對象瀏覽器中引用的程序集,但我總是得到一個錯誤,指出「http://microsoft.com/HealthCare/HL7/2X:MSH_25_GLO_DEF未聲明,當我認爲我的架構。

我也試圖改變進口提及的包括:

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

,但得到vieweing架構時,不同的錯誤:

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架構在另一有道部件?

回答

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" ... /> 
+0

歡迎堆棧溢出!雖然這可能在理論上回答這個問題,[這將是更可取的](http://meta.stackexchange.com/q/8259)在這裏包括答案的重要部分,並提供供參考的鏈接。 – JJJ 2013-03-18 20:09:40

+0

嗨Juhana - 我編輯Nihar的答案,並添加必要的細節 – Jeremy 2013-03-18 22:24:45