Moderators: e_phoenix13
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Junior Member
Posted
Hello all, I am new to this site so please be gentle...I am working on a schema to map in xml files to SQL tables. I have a VB script that loads the files into a DB based off of the schema. The tables loaded are Vendor, Placement, Patient, Facility, Summary and Comment. I had the schema working and loading nicely but I missed 1 table, "Services". I went back to work on the schema and add in this table but now cannot get it to work right. I am getting the following long error when I try to run my VB script:

Schema: unable to load schema_v2.xsd. An error occured (schema_V2.xsd#/schema[1]/element[position()=1 and @name = Data]/complextype[1]/sequence[1]/element[position()=3 and @name=Vendor]/complextype[1]/sequence[1]/element[position()=5 and @name = Placement]/complextype[1]/sequence[1]/element[position()=8 and @name = Services]
In the same scope elements with the same name, Services have to be the same type
Error Code 80004005

does anyone know what this is saying?? I have never seen this... my new XML code is as follows:


<?xml version="1.0" standalone="no"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:sql="urn:schemas-microsoft-com:mapping-schema">

<xs:annotation>
<xs:appinfo>
<sql:relationship name="VenPlace"
parent="Vendor"
parent-key="Confirmed_Id"
child="Placement"
child-key="Confirmed_Id" />
</xs:appinfo>
</xs:annotation>

<xs:annotation>
<xs:appinfo>
<sql:relationship name="PlacePatient"
parent="Placement"
parent-key="Confirmed_Id"
child="Patient"
child-key="Confirmed_Id" />
</xs:appinfo>
</xs:annotation>

<xs:annotation>
<xs:appinfo>
<sql:relationship name="VenComment"
parent="Vendor"
parent-key="Confirmed_Id"
child="Comment"
child-key="Confirmed_Id" />
</xs:appinfo>
</xs:annotation>

<xs:annotation>
<xs:appinfo>
<sql:relationship name="PlacePat"
parent="Placement"
parent-key="Pat_Mem_Num"
child="Patient"
child-key="Mem_Num" />
</xs:appinfo>
</xs:annotation>

<xs:annotation>
<xs:appinfo>
<sql:relationship name="PlaceServ"
parent="Placement"
parent-key="Aoplc_Num"
child="Service"
child-key="Aoplc_Num" />
</xs:appinfo>
</xs:annotation>

<xs:annotation>
<xs:appinfo>
<sql:relationship name="PlaceCom"
parent="Placement"
parent-key="Aoplc_Num"
child="Comment"
child-key="Aoplc_Num" />
</xs:appinfo>
</xs:annotation>

<xs:element name="Data" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element name="Summary" sql:relation="Summary">
<xs:complexType>
<xs:sequence>
<xs:element name="Count_AhCmt_Num" type="xs:integer"/>
<xs:element name="Count_AhSvc_Num" type="xs:integer"/>
<xs:element name="Sum_Svc_Amt" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Facility" sql:relation="Facility">
<xs:complexType>
<xs:sequence>
<xs:element name="Descr" type="xs:string"/>
<xs:element name="Hosp_Id" type="xs:string"/>
<xs:element name="Fac_Cd" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Vendor" sql:relation="Vendor">
<xs:complexType>
<xs:sequence>
<xs:element name="Confirmed_Id" type="xs:string"/>
<xs:element name="Holding_Id" type="xs:string"/>
<xs:element name="Vnd_Cd" type="xs:string"/>
<xs:element name="Vnd_Num" type="xs:string"/>
<xs:element name="Placement" sql:relation="Placement" sql:relationship="VenPlace">
<xs:complexType>
<xs:sequence>
<xs:element name="Confirmed_Id" type="xs:string"/>
<xs:element name="Aoplc_Num" type="xs:string"/>
<xs:element name="Bal_Amt" type="xs:decimal"/>
<xs:element name="Pat_Acct_Num" type="xs:string"/>
<xs:element name="Pat_Mem_Num" type="xs:string"/>
<xs:element name="Services" type="xs:string"/>
<xs:element name="Patient" sql:relation="Patient" sql:relationship="PlacePat">
<xs:complexType>
<xs:sequence>
<xs:element name="Confirmed_Id" type="xs:string"/>
<xs:element name="Mem_Num" type="xs:string"/>
<xs:element name="Lnm" type="xs:string"/>
<xs:element name="Fnm" type="xs:string"/>
<xs:element name="Mi" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Services" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element name="Service" sql:relation="Service" sql:relationship="PlaceServ">
<xs:complexType>
<xs:sequence>
<xs:element name="Ahsvc_Num" type="xs:string"/>
<xs:element name="Aoplc_Num" type="xs:string"/>
<xs:element name="Svc_Cd" type="xs:string"/>
<xs:element name="Svc_Chg" type="xs:decimal"/>
<xs:element name="Post_Dt" type="xs:string"/>
<xs:element name="Typ_Cd" type="xs:string"/>
<xs:element name="Pay_Responsible_Cd" type="xs:string"/>
<xs:element name="Descr" type="xs:string"/>
<xs:element name="Ipt_Batch_Num" type="xs:string"/>
<xs:element name="Add_User_Id" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Comments" sql:is-constant="1">
<xs:complexType>
<xs:sequence>
<xs:element name="Comment" sql:relation="Comment" sql:relationship="PlaceCom">
<xs:complexType>
<xs:sequence>
<xs:element name="Confirmed_Id" type="xs:string"/>
<xs:element name="Ahcmt_Num" type="xs:string"/>
<xs:element name="Aoplc_Num" type="xs:string"/>
<xs:element name="Svc_Cd" type="xs:string"/>
<xs:element name="Svc_Dt" type="xs:string"/>
<xs:element name="Post_Dt" type="xs:string"/>
<xs:element name="Descr" type="xs:string"/>
<xs:element name="Ipt_Batch_Num" type="xs:string"/>
<xs:element name="Add_User_Id" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

...been stuck on this error for a week now...thanks for any help guys!!
 
Posts: 1 | Registered: January 19, 2009Reply With QuoteEdit or Delete MessageReport This Post
Junior Member
Posted Hide Post
Hi sirrahhc,

Inside your element "Placements" you have an element named "Services" already, this contractdicts the complex type element you newly created also called "Services" rename one to resolve the issue.

<xs:element name="Confirmed_Id" type="xs:string"/>
<xs:element name="Aoplc_Num" type="xs:string"/>
<xs:element name="Bal_Amt" type="xs:decimal"/>
<xs:element name="Pat_Acct_Num" type="xs:string"/>
<xs:element name="Pat_Mem_Num" type="xs:string"/>
<xs:element name="Services" type="xs:string"/>
<xs:element name="Patient" sql:relation="Patient" sql:relationship="PlacePat">
 
Posts: 3 | Registered: June 08, 2009Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community