|
next
|
 Subject: Opening Biztalk schema that references other schemas Author: Neal Walters Date: 02 Feb 2006 10:57 AM
|
I'm trying to open a Biztalk schema. In Biztalk, we have projects and we make references to other projects, so a schema in one project can include elements that tie to a schema in another project.
When I open the schema below, I get errors like this:
The file:///c:/shared/etc/Compassion.Biztalk.Schemas.CCQ.CICCQPackageCode does not exist.
I see that you are getting this from the "schemalocation" element, but no such file physically exists, the actual filename is:
file:///c:/shared/etc/Compassion.Biztalk.Schemas.CCQ/CICCQPackageCode.xsd.
Also, I'm getting an additional error message, when I try to map from this schema. I create an XSLT map, click "Add Source Document", select the "Order" schema below, and the error says: "Schema file doesn't have the root element. Do you want to open the schema file and review it?
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://schemas.compassion.com/order/2006-01-01" xmlns:pkg="http://schemas.compassion.com/ccq/packagecode/2006-01-01" xmlns:item="http://schemas.compassion.com/order/orderitem/2006-01-01" xmlns:prof="http://schemas.compassion.com/constituent/profile/profile/2005-03-01" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:ur="http://schemas.compassion.com/common/updaterecord/2005-03-01" xmlns:ex="http://schemas.compassion.com/common/exceptions/2005-03-01" elementFormDefault="qualified" targetNamespace="http://schemas.compassion.com/order/2006-01-01" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation="Compassion.BizTalk.Schemas.Common.CIExceptions" namespace="http://schemas.compassion.com/common/exceptions/2005-03-01" />
<xs:import schemaLocation=".\ciorderlineitem.xsd" namespace="http://schemas.compassion.com/order/orderitem/2006-01-01" />
<xs:import schemaLocation="Compassion.BizTalk.Schemas.CCQ.CICCQPackageCode" namespace="http://schemas.compassion.com/ccq/packagecode/2006-01-01" />
<xs:import schemaLocation="Compassion.BizTalk.Schemas.Profile.CIProfile" namespace="http://schemas.compassion.com/constituent/profile/profile/2005-03-01" />
<xs:import schemaLocation="Compassion.BizTalk.Schemas.Common.CIUpdateRecord" namespace="http://schemas.compassion.com/common/updaterecord/2005-03-01" />
<xs:annotation>
<xs:appinfo>
<b:references>
<b:reference targetNamespace="http://schemas.compassion.com/common/updaterecord/2005-03-01" />
<b:reference targetNamespace="http://schemas.compassion.com/common/exceptions/2005-03-01" />
<b:reference targetNamespace="http://schemas.compassion.com/order/orderitem/2006-01-01" />
<b:reference targetNamespace="http://schemas.compassion.com/constituent/profile/profile/2005-03-01" />
<b:reference targetNamespace="http://schemas.compassion.com/ccq/packagecode/2006-01-01" />
</b:references>
</xs:appinfo>
</xs:annotation>
<xs:element name="Order">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="OrderHeaderId" type="xs:long" />
<xs:element minOccurs="0" maxOccurs="1" name="CampaignCode" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="ConstituentId" type="xs:long" />
<xs:element minOccurs="0" maxOccurs="1" name="OrderTypeCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="C" />
<xs:enumeration value="SR" />
<xs:enumeration value="MA" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="AccountCode" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" name="OrderStatusCode" type="xs:string" />
<xs:element minOccurs="1" maxOccurs="1" name="RequestDate" type="xs:dateTime" />
<xs:element minOccurs="0" maxOccurs="1" name="EnteredDate" type="xs:dateTime" />
<xs:element minOccurs="0" maxOccurs="1" name="NeedByDate" type="xs:dateTime" />
<xs:element name="OrderPartitionStatusCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="NoExceptions" />
<xs:enumeration value="InventoryExceptionsOnly" />
<xs:enumeration value="BusinessExceptionsOnly" />
<xs:enumeration value="NotSavedWithExceptions" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="SpecialInstruction" type="xs:string" />
<xs:element minOccurs="0" maxOccurs="1" ref="prof:Profile" />
<xs:element minOccurs="0" maxOccurs="1" name="OrderItems">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="item:OrderItem" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" name="CCQPackages">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" ref="pkg:CCQPackageCode" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element minOccurs="0" maxOccurs="1" ref="ex:Exceptions" />
<xs:element ref="ur:UpdateRecord" />
<xs:any minOccurs="0" maxOccurs="unbounded" namespace="##local" processContents="lax" />
</xs:sequence>
<xs:attribute name="SchemaVersion" type="xs:decimal" />
<xs:attribute name="PartnerCountryCode" type="xs:string" />
<xs:anyAttribute namespace="##any" />
</xs:complexType>
</xs:element>
</xs:schema>
Release Info: Build 501h eval version 2006 XML Enterprise Edition.
At the last site I worked at, we started using Stylus Studio for all our complex Biztalk maps because of the excellent debugging capabilities. At that site, we didn't have any references to other schemas.
Thanks again,
Neal Walters
http://Biztalk-Training.com - 3 CD ROM Videos Teach Biztalk
|
next
|
 Subject: Opening Biztalk schema that references other schemas Author: Neal Walters Date: 10 Feb 2006 04:31 PM
|
I had some time today to get back to this issue. I read over the page you pointed me to, watched the video, but I think I fell off the track somewhere.
I created a project called "BiztalkOrders" and created a file in that project called "CompassionCatalogForStylusStudio.xml".
It contains the following:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog SYSTEM "www.stylusstudio.com/Stylus-Catalog.dtd">
<!--
Copyright (c) 2004-2005 Progress Software Corporation. All rights reserved.
http://www.progress.com
Stylus Studio
http://www.stylusstudio.com/
-->
<catalog xmlns:stylus="http://www.stylusstudio.com/catalog">
<stylus:description>Compassion Catalog for Biztalk Schemas (required to resolve references)</stylus:description>
<group>
<public publicId="http://schemas.compassion.com/common/exceptions/2005-03-01"
uri="file:///c:/Shared/CI-OMC/SourceCode/Compassion.BizTalk/CompassionCatalogForStylusStudio.xml"/>
<public publicId="http://schemas.compassion.com/common/updaterecord/2005-03-01"
uri="file:///c:/Shared/CI-OMC/SourceCode/Compassion.BizTalk/Compassion.BizTalk.Schemas.Common/CIUpdateRecord.xsd"/>
</group>
</catalog>
I created this as regular XML file, saved it and then used "Project/Add User-Defined Catalog".
So am I on the right track so far?
I specified the schemas namespace in the "public" attribute, then in the uri I specified the name of the file on the hard-drive that contains that schema.
Now what?
I create a new XSLT map and still get the error.
I was under the idea I have to add the XSLT map to the project, but I don't see that option. I saved the empty XSLT map to disk, then added it to project, but I still get the original error
"Schema doesn't have the root element. Do you want to open the schema file and review it."?
I also added my catalog to the bottom of the list of catalog in BaseCatalog:
<nextCatalog catalog="xhtml.xml"/>
<nextCatalog catalog="c:\Shared\CI-OMC\SourceCode\Compassion.BizTalk\CompassionCatalogForStylusStudio.xml"/>
</catalog>
Also if I try to validate my schema I get this:
Validating CIOrderStartedOrchResponse.xsd...
file:///c:/Shared/CI-OMC/SourceCode/Compassion.BizTalk/Compassion.BizTalk.Schemas.Order/CIOrderStartedOrchResponse.xsd:3,155: FATAL ERROR: Cannot open Compassion.BizTalk.Schemas.Common.CIUpdateRecord
Also, it would be great to have a wizard build all this for us. We probably have 100 schemas, so that means I'll have to build the catalog file. I may write a program to do it, I basically would need to just open every .XSD, get the namespace, then save the namespace and the filename to the catalog file, right?
Thanks again,
Neal Walters
http://Biztalk-Training.com
|
next
|
 Subject: Opening Biztalk schema that references other schemas Author: Tony Lavinio Date: 10 Feb 2006 04:44 PM
|
First, you don't need the <group></group>, but it won't hurt.
Second, for publicId is for public IDs, as in a DOCTYPE's PUBLIC
value. Instead of
<public publicId="..." uri="....xsd"/>
you should use
<use name="..." uri="....xsd"/>
If you try this and it doesn't work, why don't you zip up the .prj,
the catalog, the xslt, the xsds, and the source xmls, and send it to
stylus-field-report (at) progress.com and we'll take a whack at it.
|
next
|
 Subject: Opening Biztalk schema that references other schemas Author: Neal Walters Date: 15 Feb 2006 11:09 AM
|
That's exactly what I have done. I have "BaseCatalog.xml" and "CompassionCatalogForStylusStudio.xml" marked as catalogs in a project called BiztalkOrders.
The simplest schema I can find is CIOrderItem which refers to just one other schema.
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:ur="http://schemas.compassion.com/common/updaterecord/2005-03-01" xmlns="http://schemas.compassion.com/order/orderitem/2006-01-01" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" elementFormDefault="qualified" targetNamespace="http://schemas.compassion.com/order/orderitem/2006-01-01" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation="Compassion.BizTalk.Schemas.Common.CIUpdateRecord" namespace="http://schemas.compassion.com/common/updaterecord/2005-03-01" />
I temporarily simplified my catalog to this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog SYSTEM "www.stylusstudio.com/Stylus-Catalog.dtd">
<catalog xmlns:stylus="http://www.stylusstudio.com/catalog">
<stylus:description>Compassion Catalog for Biztalk Schemas (required to resolve references)</stylus:description>
<use name="http://schemas.compassion.com/common/updaterecord/2005-03-01"
uri="file:///c:/Shared/CI-OMC/SourceCode/Compassion.BizTalk/Compassion.BizTalk.Schemas.Common/CIUpdateRecord.xsd"/>
</catalog>
When I check to see if the catalog file is well-formed, I get this error:
Checking CompassionCatalogForStylusStudio.xml...
file:///c:/Shared/CI-OMC/SourceCode/Compassion.BizTalk/CompassionCatalogForStylusStudio.xml:2,68: FATAL ERROR: Cannot open www.stylusstudio.com/Stylus-Catalog.dtd
The DOCTYPE statement is identical to the one in the base catalog (where the well-formed check works fine).
I have verified the file in the catalog exists by copying it, doing a file open, then pasting the file name, and it opens fine.
BUT - you still haven't answered one question. How does Stylus Studio know to use which "project". For instance, if I have Stylus Studio closed, and I right-click open a schema with Stylus Studio.
I think I just figured out one BIG ISSUE. I have to be in Stylus Studio (with the project open) and then open the schema. I have been using Windows and then right-clicking "open with" then program "Stylus Studio". Even though Stylus Studio was running and the project was open, the schema opens and gets the errors.
HOWEVER - even though I can get OrderLineItem to open from within Stylus Studio, I still get the same file not found errors when I try to open the CIOrder.xsd.
So I still don't understand your logic or how you are coming up with this error:
file:///c:/Shared/CI-OMC/SourceCode/Compassion.Biztalk/Compassion.BizTalk.Schemas.Order/Compassion.BizTalk.Schemas.CCQ.CICCQPackageCode does not exist.
According to my understanding, you look at the following import statements in the CIOrder.xsd.
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns="http://schemas.compassion.com/order/2006-01-01" xmlns:pkg="http://schemas.compassion.com/ccq/packagecode/2006-01-01" xmlns:item="http://schemas.compassion.com/order/orderitem/2006-01-01" xmlns:prof="http://schemas.compassion.com/constituent/profile/profile/2005-03-01" xmlns:ur="http://schemas.compassion.com/common/updaterecord/2005-03-01" xmlns:ex="http://schemas.compassion.com/common/exceptions/2005-03-01" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns:ns0="http://Compassion.BizTalk.Schemas.Order.PropertySchema.PropertySchema" elementFormDefault="qualified" targetNamespace="http://schemas.compassion.com/order/2006-01-01" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import schemaLocation="Compassion.BizTalk.Schemas.Common.CIExceptions" namespace="http://schemas.compassion.com/common/exceptions/2005-03-01" />
<xs:import schemaLocation=".\ciorderlineitem.xsd" namespace="http://schemas.compassion.com/order/orderitem/2006-01-01" />
<xs:import schemaLocation="Compassion.BizTalk.Schemas.CCQ.CICCQPackageCode" namespace="http://schemas.compassion.com/ccq/packagecode/2006-01-01" />
<xs:import schemaLocation="Compassion.BizTalk.Schemas.Profile.CIProfile" namespace="http://schemas.compassion.com/constituent/profile/profile/2005-03-01" />
<xs:import schemaLocation="Compassion.BizTalk.Schemas.Common.CIUpdateRecord" namespace="http://schemas.compassion.com/common/updaterecord/2005-03-01" />
Another question - do you do anything with the schemaLocation attribute or do you ignore it?
You see a namespace http://schemas.compassion.com/ccq/packagecode/2006-01-01 and you look up this namespace in all the catalogs.
You go to my catalog and find this line:
<use name="http://schemas.compassion.com/ccq/packagecode/2006-01-01" uri="file:///c:\Shared\CI-OMC\SourceCode\Compassion.BizTalk\Compassion.BizTalk.Schemas.CCQ\CICCQPackageCode.xsd"/>
You try to open this file, but obviously this file exists, and this file name is different than the filename that the error is reporting.
The error is correct that the file does not exist, because the directory name is wrong. So apparently the software is not using my catalog in this instance.
How else can I trace through this. It's starting to drive me crazy.
Thanks again,
Neal
|
|
|
|