Modifying 2.XML Schemas to Work with BizTalk Editor

HL7 2.XML schemas require modification to work properly with Microsoft BizTalk Accelerator for HL7 (BTAHL7). The following describes how to modify HL7 V2.XML schemas to enable you to use them with BizTalk Editor.


The Update2XMLSchema tool performs these steps automatically. See Update2XMLSchema Tool for more information.


The nillable attribute can occur in a schema on an element. If set to true, it indicates that the instance of the parent element can have an xsi:nil="true" attribute. BTAHL7 ignores this attribute during compilation and during parsing/serialization.

To modify 2.XML schemas

  1. In the fields.xsd file, you must remove instances of import and replace them with include. For example, search the fields.xsd file for the following text:

    <xsd:import namespace="urn:hl7-org:v2xml" schemaLocation="datatypes.xsd"/>   

    And change the text to the following:

    <xsd:include schemaLocation="datatypes.xsd"/>   
  2. In the segments.xsd file, you must remove all instances of the lines that contain the text processContents="lax". For example, search the segments.xsd file for the following text:

    <xsd:any processContents="lax" namespace="##any" minOccurs="0"/>   


    <xsd:any processContents="lax" namespace="##any"/>   

    And remove those lines.

  3. For all schemas, under the tag xsd:schema, you must add the following line:


    Do not add this line if you have added the schema using MicrosoftVisual Studio because Visual Studio does this for you automatically.


    For example, in the file ADT_A01.xsd, search for the following text:


    And change the text to the following:

  4. For all schemas, you must add a root reference. For example, in the ADT_A01.xsd file, search for the following text:

    <xsd:include schemaLocation="segments.xsd" />   

    And change the text to:

    <xsd:include schemaLocation="segments.xsd" />  
        <schemaInfo root_reference="ADT_A01"  
     xmlns="" />   


    If you are using Visual Studio, you can add this root_reference by using the following procedure.

To add the root reference

  1. In Solution Explorer, double-click the schema you want to edit.

  2. In the Properties pane, scroll down to the property root_reference, and from the drop-down list, click the property with the same schema name.

  3. On the File menu, click Save All.

See Also

Using HL7 2.XML Schemas