Wednesday, March 28, 2012

Mapping issue

Part 0f the Schema
<xs:element name="Advice" sql:is-constant="true">
<xs:complexType>
<xs:sequence>
<xs:element name="OriginatingAccountRecords" sql:is-constant="true">
<xs:complexType>
<xs:sequence>
<xs:element name="OriginatingAccountRecord" sql:is-constant="true">
<xs:complexType>
<xs:sequence>
<xs:element name="OriginatingAccount"
sql:relation="XML_OriginatingAccount">
<xs:complexType>
<xs:attribute name="number" sql:field="number" sql:datatype="varchar"/>
<xs:attribute name="sortCode" sql:field="sortcode"
sql:datatype="varchar"/>
<xs:attribute name="bankName" sql:field="bankname"
sql:datatype="varchar"/>
<xs:attribute name="branchName" sql:field="branchname"
sql:datatype="varchar"/>
</xs:complexType>
</xs:element>
<xs:element name="ReturnedDebitItem" sql:relation="XML_ReturnedDebitItem">
<xs:complexType>
<xs:attribute name="ref" sql:field="ref" sql:datatype="varchar"/>
<xs:attribute name="transCode" sql:field="transcode"
sql:datatype="varchar"/>
<xs:attribute name="returnCode" sql:field="returncode"
sql:datatype="varchar"/>
<xs:attribute name="returnDescription" sql:field="returndescription"
sql:datatype="varchar"/>
<xs:attribute name="originalProcessingDate"
sql:field="originalprocessingdate" sql:datatype="varchar"/>
<xs:attribute name="valueOf" sql:field="valueof" sql:datatype="varchar"/>
<xs:attribute name="currency" sql:field="currency"
sql:datatype="varchar"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
XML File
<?xml version="1.0" encoding="ISO-8859-1"?>
<BACSDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="newbacs-advices.xsd">
<Data>
<ARUDD>
<Header reportType="REFT" adviceNumber="00004"
currentProcessingDate="1999-12-30"/>
<AddresseeInformation name="A NAMES" address1="ADDRESS LINE 1"
address2="ADDRESS LINE 2" address3="ADDRESS LINE 3" address4="ADDRESS LINE 4"
address5="ADDRESS LINE 5"/>
<ServiceLicenseInformation userName="A USER" userNumber="999999"/>
<Advice>
<OriginatingAccountRecords>
<OriginatingAccountRecord>
<OriginatingAccount number="99999999" sortCode="99-99-99" bankName="A
BANK" branchName="TOWN CENTRE"/>
<ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
<PayerAccount name="SB04012027-10.0078" sortCode="11-11-11"
number="11111111"/>
</ReturnedDebitItem>
<ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
<PayerAccount name="SB04012027-01.0078" sortCode="22-22-22"
number="22222222"/>
</ReturnedDebitItem>
<ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
<PayerAccount name="SB04072017-01.0078" sortCode="33-33-33"
number="33333333"/>
</ReturnedDebitItem>
<ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
<PayerAccount name="SB04012027-06.0078" sortCode="44-44-44"
number="44444444"/>
</ReturnedDebitItem>
<ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
<PayerAccount name="SB04012028-04.0078" sortCode="55-55-55"
number="55555555"/>
</ReturnedDebitItem>
<ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
<PayerAccount name="SB04204005-01.0078" sortCode="66-66-66"
number="66666666"/>
</ReturnedDebitItem>
<ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
<PayerAccount name="SB04519015-01.0078" sortCode="77-77-77"
number="77777777"/>
</ReturnedDebitItem>
<Totals numberOf="7" currency="GBP" valueOf="1618.75"/>
</OriginatingAccountRecord>
</OriginatingAccountRecords>
</Advice>
</ARUDD>
</Data>
<SignatureMethod/>
<Signature/>
</BACSDocument>
The problem im hving id trying to insert the <PayerAccount> details to a
different table then the <ReturnedDebitItems>
Your schema should define the <PayerAccount> element as a child of the
<ReturnedDebitItems>.
looks like now it is not defined.
and then add a sql:relation to the different table where <PayerAccount>
should go.
In order to define the <PayerAccount> as a child of <returnedDebitItems> you
need to define a sql:relationship element between the two.
HTH
Chandra
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
"Peter Newman" <PeterNewman@.discussions.microsoft.com> wrote in message
news:E9D5CF0F-23F4-4E6A-B687-5D4DDF768464@.microsoft.com...
> Part 0f the Schema
> <xs:element name="Advice" sql:is-constant="true">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="OriginatingAccountRecords" sql:is-constant="true">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="OriginatingAccountRecord" sql:is-constant="true">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="OriginatingAccount"
> sql:relation="XML_OriginatingAccount">
> <xs:complexType>
> <xs:attribute name="number" sql:field="number" sql:datatype="varchar"/>
> <xs:attribute name="sortCode" sql:field="sortcode"
> sql:datatype="varchar"/>
> <xs:attribute name="bankName" sql:field="bankname"
> sql:datatype="varchar"/>
> <xs:attribute name="branchName" sql:field="branchname"
> sql:datatype="varchar"/>
> </xs:complexType>
> </xs:element>
> <xs:element name="ReturnedDebitItem" sql:relation="XML_ReturnedDebitItem">
> <xs:complexType>
> <xs:attribute name="ref" sql:field="ref" sql:datatype="varchar"/>
> <xs:attribute name="transCode" sql:field="transcode"
> sql:datatype="varchar"/>
> <xs:attribute name="returnCode" sql:field="returncode"
> sql:datatype="varchar"/>
> <xs:attribute name="returnDescription" sql:field="returndescription"
> sql:datatype="varchar"/>
> <xs:attribute name="originalProcessingDate"
> sql:field="originalprocessingdate" sql:datatype="varchar"/>
> <xs:attribute name="valueOf" sql:field="valueof"
> sql:datatype="varchar"/>
> <xs:attribute name="currency" sql:field="currency"
> sql:datatype="varchar"/>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> XML File
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <BACSDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="newbacs-advices.xsd">
> <Data>
> <ARUDD>
> <Header reportType="REFT" adviceNumber="00004"
> currentProcessingDate="1999-12-30"/>
> <AddresseeInformation name="A NAMES" address1="ADDRESS LINE 1"
> address2="ADDRESS LINE 2" address3="ADDRESS LINE 3" address4="ADDRESS LINE
> 4"
> address5="ADDRESS LINE 5"/>
> <ServiceLicenseInformation userName="A USER" userNumber="999999"/>
> <Advice>
> <OriginatingAccountRecords>
> <OriginatingAccountRecord>
> <OriginatingAccount number="99999999" sortCode="99-99-99" bankName="A
> BANK" branchName="TOWN CENTRE"/>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04012027-10.0078" sortCode="11-11-11"
> number="11111111"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04012027-01.0078" sortCode="22-22-22"
> number="22222222"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04072017-01.0078" sortCode="33-33-33"
> number="33333333"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04012027-06.0078" sortCode="44-44-44"
> number="44444444"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04012028-04.0078" sortCode="55-55-55"
> number="55555555"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04204005-01.0078" sortCode="66-66-66"
> number="66666666"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04519015-01.0078" sortCode="77-77-77"
> number="77777777"/>
> </ReturnedDebitItem>
> <Totals numberOf="7" currency="GBP" valueOf="1618.75"/>
> </OriginatingAccountRecord>
> </OriginatingAccountRecords>
> </Advice>
> </ARUDD>
> </Data>
> <SignatureMethod/>
> <Signature/>
> </BACSDocument>
> The problem im hving id trying to insert the <PayerAccount> details to a
> different table then the <ReturnedDebitItems>
|||Your schema does not reflect your document. You should add to your schema the
<PayerAccount> element and then map it to a different table using
sql:relation and sql:relationship annotation
Regards,
Avner
"Peter Newman" wrote:

> Part 0f the Schema
> <xs:element name="Advice" sql:is-constant="true">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="OriginatingAccountRecords" sql:is-constant="true">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="OriginatingAccountRecord" sql:is-constant="true">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="OriginatingAccount"
> sql:relation="XML_OriginatingAccount">
> <xs:complexType>
> <xs:attribute name="number" sql:field="number" sql:datatype="varchar"/>
> <xs:attribute name="sortCode" sql:field="sortcode"
> sql:datatype="varchar"/>
> <xs:attribute name="bankName" sql:field="bankname"
> sql:datatype="varchar"/>
> <xs:attribute name="branchName" sql:field="branchname"
> sql:datatype="varchar"/>
> </xs:complexType>
> </xs:element>
> <xs:element name="ReturnedDebitItem" sql:relation="XML_ReturnedDebitItem">
> <xs:complexType>
> <xs:attribute name="ref" sql:field="ref" sql:datatype="varchar"/>
> <xs:attribute name="transCode" sql:field="transcode"
> sql:datatype="varchar"/>
> <xs:attribute name="returnCode" sql:field="returncode"
> sql:datatype="varchar"/>
> <xs:attribute name="returnDescription" sql:field="returndescription"
> sql:datatype="varchar"/>
> <xs:attribute name="originalProcessingDate"
> sql:field="originalprocessingdate" sql:datatype="varchar"/>
> <xs:attribute name="valueOf" sql:field="valueof" sql:datatype="varchar"/>
> <xs:attribute name="currency" sql:field="currency"
> sql:datatype="varchar"/>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> XML File
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <BACSDocument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="newbacs-advices.xsd">
> <Data>
> <ARUDD>
> <Header reportType="REFT" adviceNumber="00004"
> currentProcessingDate="1999-12-30"/>
> <AddresseeInformation name="A NAMES" address1="ADDRESS LINE 1"
> address2="ADDRESS LINE 2" address3="ADDRESS LINE 3" address4="ADDRESS LINE 4"
> address5="ADDRESS LINE 5"/>
> <ServiceLicenseInformation userName="A USER" userNumber="999999"/>
> <Advice>
> <OriginatingAccountRecords>
> <OriginatingAccountRecord>
> <OriginatingAccount number="99999999" sortCode="99-99-99" bankName="A
> BANK" branchName="TOWN CENTRE"/>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04012027-10.0078" sortCode="11-11-11"
> number="11111111"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04012027-01.0078" sortCode="22-22-22"
> number="22222222"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04072017-01.0078" sortCode="33-33-33"
> number="33333333"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04012027-06.0078" sortCode="44-44-44"
> number="44444444"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04012028-04.0078" sortCode="55-55-55"
> number="55555555"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04204005-01.0078" sortCode="66-66-66"
> number="66666666"/>
> </ReturnedDebitItem>
> <ReturnedDebitItem ref="REFERENCE DDI CR3739" transCode="19"
> returnCode="8362" returnDescription="AMOUNT NOT YET DUE"
> originalProcessingDate="1999-12-28" valueOf="231.25" currency="GBP">
> <PayerAccount name="SB04519015-01.0078" sortCode="77-77-77"
> number="77777777"/>
> </ReturnedDebitItem>
> <Totals numberOf="7" currency="GBP" valueOf="1618.75"/>
> </OriginatingAccountRecord>
> </OriginatingAccountRecords>
> </Advice>
> </ARUDD>
> </Data>
> <SignatureMethod/>
> <Signature/>
> </BACSDocument>
> The problem im hving id trying to insert the <PayerAccount> details to a
> different table then the <ReturnedDebitItems>

No comments:

Post a Comment