RE: Importing Complex Schemas

From: Tatyana Yakushev [MSFT] (tatyanam_at_online.microsoft.com)
Date: 11/18/04


Date: Thu, 18 Nov 2021 18:56:43 GMT

If you plan to receive XML messages that contain that root only, you can change Root Reference property.

However if you plan to receive XML messages that have other roots defined in the schema, you should not set Root Reference.

To get rid of "This schema file has a TypeName that collides with the RootNode TypeName of one of its root nodes. Make sure that they are different." error, you need to
select that root and change value of "RootNode TypeName" property.

Regards,
Tatyana

--------------------
>Thread-Topic: Importing Complex Schemas
>thread-index: AcTI0EJ/jLQ3qgI2Q+iBPtLWAkQORA==
>X-WBNR-Posting-Host: 64.252.81.96
>From: =?Utf-8?B?Qm9iIEMu?= <BobC@discussions.microsoft.com>
>References: <9DF7C138-8DD4-4C09-A7CC-40CD48B0F3EE@microsoft.com> <hz#3ouFyEHA.3640@cpmsftngxa10.phx.gbl> <C3CB213C-CA2A-471D-9CC8-
E0FA3D199CF3@microsoft.com>
>Subject: RE: Importing Complex Schemas
>Date: Fri, 12 Nov 2021 07:57:06 -0800
>Lines: 125
>Message-ID: <B70BA08E-E47F-49B6-A5D7-2771B45F4940@microsoft.com>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="Utf-8"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Content-Class: urn:content-classes:message
>Importance: normal
>Priority: normal
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>Newsgroups: microsoft.public.biztalk.general
>NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
>Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21597
>X-Tomcat-NG: microsoft.public.biztalk.general
>
>After further investigation, I was able to handle the element reference
>situation mentioned in my previous post by simply right clicking on the
><schema> node and changing the 'Root Refernce' property from 'default' to the
>referenced type in question.
>
>Thanks Tatyana.
>
>"Bob C." wrote:
>
>> I am adding the existing (dependency) schemas into the project one at a time.
>> I can get them to validate in most cases by completely removing the drive
>> path in the schemaLocation value. So, instead of
>> <xsd:include schemaLocation="./CPO/TelcomNumber.xsd"/>
>> I need to edit out the drive path like this:
>> <xsd:include schemaLocation="TelcomNumber.xsd"/>
>>
>> This works in most cases, but there is a further issue when we have an
>> xsd:element declaration that references a complex type in its own schema.
>> Here is an example:
>>
>> <xsd:complexType name="PostalAddressType">
>> // element declarations, etc.
>> .................
>> </xsd:complexType>
>> <xsd:element name="PostalAddress" type="PostalAddressType"/>
>>
>> By adding the element declaration in the last line, we simply reference the
>> element from another schema, like this:
>> <xsd:element ref="PostalAddress" minOccurs="0"/>
>> instead of doing this:
>> <xsd:element name="PostalAddress" type="PostalAddressType" minOccurs="0"/>
>> This helps us minimize complicated namespacing.
>>
>> However, the element declaration
>> <xsd:element name="PostalAddress" type="PostalAddressType"/>
>> in the last line of the PostalAddress schema is causing the following error
>> when I try to validate the schema:
>>
>> 'PostalAddress.xsd Node "<Schema>" - This schema file has a TypeName that
>> collides with the RootNode TypeName of one of its root nodes. Make sure that
>> they are different.'
>>
>> I can get around this by deleting the line
>> <xsd:element name="PostalAddress" type="PostalAddressType" minOccurs="0"/>
>> but then I have to hunt down all of the references to this element in other
>> schemas and change the declaration from
>> <xsd:element ref="PostalAddress" minOccurs="0"/>
>> to
>> <xsd:element name="PostalAddress" type="PostalAddressType" minOccurs="0"/>
>>
>> We have many instances of this type of notation, so the resulting editing
>> would be painstaking and error prone.
>>
>> I should note that I can import the schema as is into other XML tools, with
>> no issues.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> "Tatyana Yakushev [MSFT]" wrote:
>>
>> > 1. You need to download all the dependency schemas and include them in your project
>> > 2. You need to update schemaLocation. It should have one dot instead of 2, e.g. <xsd:include schemaLocation="./CPO/TelcomNumber.xsd"/>
>> >
>> > Everything else should be fine
>> >
>> > Regards,
>> > Tatyana
>> >
>> > --------------------
>> > >Thread-Topic: Importing Complex Schemas
>> > >thread-index: AcTIQVZg4xPgS/0NTBKcYo9LmtvXfg==
>> > >X-WBNR-Posting-Host: 64.252.81.96
>> > >From: =?Utf-8?B?Qm9iIEMu?= <BobC@discussions.microsoft.com>
>> > >Subject: Importing Complex Schemas
>> > >Date: Thu, 11 Nov 2021 14:54:02 -0800
>> > >Lines: 16
>> > >Message-ID: <9DF7C138-8DD4-4C09-A7CC-40CD48B0F3EE@microsoft.com>
>> > >MIME-Version: 1.0
>> > >Content-Type: text/plain;
>> > > charset="Utf-8"
>> > >Content-Transfer-Encoding: 7bit
>> > >X-Newsreader: Microsoft CDO for Windows 2000
>> > >Content-Class: urn:content-classes:message
>> > >Importance: normal
>> > >Priority: normal
>> > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
>> > >Newsgroups: microsoft.public.biztalk.general
>> > >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
>> > >Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
>> > >Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:21572
>> > >X-Tomcat-NG: microsoft.public.biztalk.general
>> > >
>> > >I need to add an existing schema that I will use to map to a number of
>> > >different flat and xml file formats. This is a major industry schema that
>> > >comprises more than a dozen schemas with varying degrees of references. The
>> > >references from one schema to another are all done with relative paths.
>> > >Example:
>> > ><xsd:include schemaLocation="../CPO/TelcomNumber.xsd"/>
>> > >
>> > >There are also references to elements in other schemas. Example:
>> > ><xsd:element ref="Pager" minOccurs="0"/>
>> > >
>> > >Can Biztalk handle situations like those listed above?
>> > >
>> > >Thanks
>> > >
>> > >--
>> > >Bob C.
>> > >
>> >
>> >
>> > --
>> >
>> > This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
>> > http://www.microsoft.com/info/cpyright.htm
>> >
>> > Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.
>> >
>> >
>

-- 
This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at 
http://www.microsoft.com/info/cpyright.htm 
Note:  For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.  


Relevant Pages

  • Re: invoke a webservice with nillable value types
    ... generate the assembly for your schema one time, ... service add a reference to the assembly we created above in XsdObjectGen. ... >It is supported to supress serialization of properties using the ... FindBDImplService failed with the error "File- or Assemblyname ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Truth
    ... We examine everything in reference to everything. ... mind is torn from its premises - and then the premises are reexamined, ... "The premise of my rationality is living on earth" - then ... education - if money is the root of all evil then what is the root of ...
    (soc.culture.china)
  • Re: Truth
    ... We examine everything in reference to everything. ... mind is torn from its premises - and then the premises are reexamined, ... "The premise of my rationality is living on earth" - then ... education - if money is the root of all evil then what is the root of ...
    (soc.culture.china)
  • Re: Truth
    ... who can afford some much time for such TRUTH. ... We examine everything in reference to everything. ... "The premise of my rationality is living on earth" - then ... education - if money is the root of all evil then what is the root of ...
    (soc.culture.china)
  • Re: SQL Receive Adapter
    ... It should be set to Root. ... child of the tblSQLAdapterTest node. ... If you set the Body Xpath to the Root node, ... Obviously it wont find this schema because there is no such thing. ...
    (microsoft.public.biztalk.general)