Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Biztalk Mapper
- This topic has 7 replies, 1 voice, and was last updated 9 years, 10 months ago by
community-content.
-
AuthorPosts
-
-
June 11, 2008 at 2:45 AM #19893
Hi,
I have an problem with a mapper that I would appricate any feedback on as I cannot resolve it.I have a multiple inbound nodes that need to map to one outbound node, but I need to be able to specfiy the REFTYPE and REFDESC.
<REFERENCE REFTYPE=”INV”>
<REFDESC>Invoice Reference Number</REFDESC>
<REFCODE>3089424</REFCODE>
</REFERENCE>
<REFERENCE REFTYPE=”ORD”>
<REFDESC>Order Reference Number</REFDESC>
<REFCODE>R-48759</REFCODE>
</REFERENCE>I have got the above by doing inline xslt, within the inbound file there are multiple invoices and instead of looping through it just puts the same reference in all of the invoices!! I hope thats clear..
Thanks in advance..
-
June 11, 2008 at 4:59 AM #19894
Can you give a sample of the input file and mock up a sample of how you want the output to look?
-
June 11, 2008 at 6:41 AM #19895
Inbound.
<?xml version=”1.0″?>
<InvoiceBatch xmlns=”http://www.ebis-xml.net/invoiceBatch-v0.1” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”urn:schemas-basda-org:2000:salesInvoice:xdr:3.01 invoice-v3.xsd http://www.ebis-xml.net/invoiceBatch-v0.1 invoiceBatch-v0.1.xsd urn:schemas-bossfed-co-uk:OP-Invoice-v1 OP-Invoice-v1.xsd”>
<Invoice xmlns=”urn:schemas-basda-org:2000:salesInvoice:xdr:3.01″>
<InvoiceHead>
<Schema>
<Version>3.05</Version>
</Schema>
<Parameters>
<Language>en-GB</Language>
<DecimalSeparator>.</DecimalSeparator>
<Precision>20.4</Precision>
</Parameters>
<InvoiceType Code=”INV”>Commercial Invoice</InvoiceType>
<InvoiceCurrency>
<Currency Code=”GBP”>Sterling</Currency>
</InvoiceCurrency>
<Checksum>65053</Checksum>
</InvoiceHead>
<InvoiceReferences>
<BuyersOrderNumber>0</BuyersOrderNumber>
<SuppliersInvoiceNumber>0</SuppliersInvoiceNumber>
<DeliveryNoteNumber>0</DeliveryNoteNumber>
</InvoiceReferences>
<OP:AdditionalInvoiceReferences xmlns:OP=”urn:schemas-bossfed-co-uk:OP-Invoice-v1″>
<OP:InvoiceReference ReferenceType=”KWOS”>
<OP:Reference>1585009</OP:Reference>
</OP:InvoiceReference>
</OP:AdditionalInvoiceReferences>
<OP:AdditionalInvoiceDates xmlns:OP=”urn:schemas-bossfed-co-uk:OP-Invoice-v1″>
<OP:InvoiceDateTime DateTimeType=”ORD” DateTimeDesc=”Order Date”>2008-05-29</OP:InvoiceDateTime>
<OP:InvoiceDateTime DateTimeType=”DEL” DateTimeDesc=”Delivery date”>2008-05-30</OP:InvoiceDateTime>
</OP:AdditionalInvoiceDates>
<InvoiceDate>2008-05-29</InvoiceDate>
<Supplier>
<SupplierReferences>
<TaxNumber>0</TaxNumber>
<GLN>7</GLN>
</SupplierReferences>
<Party>Test Ltd (Head Office)</Party>
<Address>
<AddressLine> Business Park</AddressLine>
</Address>
</Supplier>
<Buyer>
<BuyerReferences>
<SuppliersCodeForBuyer>R1595</SuppliersCodeForBuyer>
</BuyerReferences>
<Party>Test UK Ltd</Party>
<Address>
<AddressLine>#</AddressLine>
</Address>
</Buyer>
<InvoiceTo>
<Party>#</Party>
</InvoiceTo>
<InvoiceLine>
<LineNumber>1</LineNumber>
<InvoiceLineReferences>
<OrderLineNumber>0</OrderLineNumber>
<BuyersOrderLineReference>R-48759</BuyersOrderLineReference>
</InvoiceLineReferences>
<OP:AdditionalInvoiceLineReferences xmlns:OP=”urn:schemas-bossfed-co-uk:OP-Invoice-v1″>
<OP:InvoiceLineReference ReferenceType=”SETFLG” ReferenceDesc=”Settlement Discount Flag”>
<OP:Reference>Y</OP:Reference>
</OP:InvoiceLineReference>
</OP:AdditionalInvoiceLineReferences>
<Product>
<SuppliersProductCode>KF04114</SuppliersProductCode>
<Description>Q CONNECT LAMG POUCH A4 80MIC PK100</Description>
</Product>
<Quantity>
<Packsize>1</Packsize>
<Amount>3150</Amount>
</Quantity>
<Price>
<UnitPrice>0</UnitPrice>
</Price>
<LineTax>
<TaxRate Code=”S”>17.50</TaxRate>
</LineTax>
<LineTotal>0</LineTotal>
</InvoiceLine>
<Settlement>
<SettlementTerms>
<DaysFromInvoice>31</DaysFromInvoice>
</SettlementTerms>
<SettlementDiscount>
<PercentDiscount>
<Percentage>2.50</Percentage>
</PercentDiscount>
<AmountDiscount>
<Amount>368.53</Amount>
</AmountDiscount>
</SettlementDiscount>
</Settlement>
<TaxSubTotal>
<TaxRate Code=”S”>17.50</TaxRate>
<NumberOfLinesAtRate>1</NumberOfLinesAtRate>
<TotalValueAtRate>14741.24</TotalValueAtRate>
<SettlementDiscountAtRate>368.53</SettlementDiscountAtRate>
<TaxableValueAtRate>14372.71</TaxableValueAtRate>
<TaxAtRate>2515.22</TaxAtRate>
<NetPaymentAtRate>16887.93</NetPaymentAtRate>
<GrossPaymentAtRate>17256.46</GrossPaymentAtRate>
<TaxCurrency>
<Currency Code=”GBP”>Sterling</Currency>
</TaxCurrency>
</TaxSubTotal>
<InvoiceTotal>
<NumberOfLines>1</NumberOfLines>
<NumberOfTaxRates>1</NumberOfTaxRates>
<LineValueTotal>14741.24</LineValueTotal>
<SettlementDiscountTotal>368.53</SettlementDiscountTotal>
<TaxableTotal>14372.71</TaxableTotal>
<TaxTotal>2515.22</TaxTotal>
<NetPaymentTotal>16887.93</NetPaymentTotal>
<GrossPaymentTotal>17256.46</GrossPaymentTotal>
</InvoiceTotal>
</Invoice>
<Invoice xmlns=”urn:schemas-basda-org:2000:salesInvoice:xdr:3.01″>
<InvoiceHead>
<Schema>
<Version>3.05</Version>
</Schema>
<Parameters>
<Language>en-GB</Language>
<DecimalSeparator>.</DecimalSeparator>
<Precision>20.4</Precision>
</Parameters>
<InvoiceType Code=”INV”>Commercial Invoice</InvoiceType>
<InvoiceCurrency>
<Currency Code=”GBP”>Sterling</Currency>
</InvoiceCurrency>
<Checksum>31001</Checksum>
</InvoiceHead>
<InvoiceReferences>
<BuyersOrderNumber>R-48734</BuyersOrderNumber>
<SuppliersInvoiceNumber>3089425</SuppliersInvoiceNumber>
<DeliveryNoteNumber>3559252</DeliveryNoteNumber>
</InvoiceReferences>
<OP:AdditionalInvoiceReferences xmlns:OP=”urn:schemas-bossfed-co-uk:OP-Invoice-v1″>
<OP:InvoiceReference ReferenceType=”KWOS”>
<OP:Reference>1585054</OP:Reference>
</OP:InvoiceReference>
</OP:AdditionalInvoiceReferences>
<OP:AdditionalInvoiceDates xmlns:OP=”urn:schemas-bossfed-co-uk:OP-Invoice-v1″>
<OP:InvoiceDateTime DateTimeType=”ORD” DateTimeDesc=”Order Date”>2008-05-29</OP:InvoiceDateTime>
<OP:InvoiceDateTime DateTimeType=”DEL” DateTimeDesc=”Delivery date”>2008-05-30</OP:InvoiceDateTime>
</OP:AdditionalInvoiceDates>
<InvoiceDate>2008-05-29</InvoiceDate>
<Supplier>
<SupplierReferences>
<TaxNumber>0</TaxNumber>
<GLN>07</GLN>
</SupplierReferences>
<Party> Test Ltd (Head Office)</Party>
<Address>
<AddressLine> Business Park</AddressLine>
</Address>
</Supplier>
<Buyer>
<BuyerReferences>
<SuppliersCodeForBuyer>R1595</SuppliersCodeForBuyer>
</BuyerReferences>
<Party>Test UK Ltd</Party>
<Address>
<AddressLine>Plot 1</AddressLine>
</Address>
</Buyer>
<InvoiceTo>
<Party>Test International BV</Party>
</InvoiceTo>
<InvoiceLine>
<LineNumber>1</LineNumber>
<InvoiceLineReferences>
<OrderLineNumber>0</OrderLineNumber>
<BuyersOrderLineReference>R-48734</BuyersOrderLineReference>
</InvoiceLineReferences>
<OP:AdditionalInvoiceLineReferences xmlns:OP=”urn:schemas-bossfed-co-uk:OP-Invoice-v1″>
<OP:InvoiceLineReference ReferenceType=”SETFLG” ReferenceDesc=”Settlement Discount Flag”>
<OP:Reference>Y</OP:Reference>
</OP:InvoiceLineReference>
</OP:AdditionalInvoiceLineReferences>
<Product>
<SuppliersProductCode>KF20038</SuppliersProductCode>
<Description>Q CONNECT L/ARCH FILE PPRBACK A4 BLK</Description>
</Product>
<Quantity>
<Packsize>10</Packsize>
<Amount>120</Amount>
</Quantity>
<Price>
<UnitPrice>0</UnitPrice>
</Price>
<LineTax>
<TaxRate Code=”S”>17.50</TaxRate>
</LineTax>
<LineTotal>0</LineTotal>
</InvoiceLine>
<InvoiceLine>
<LineNumber>2</LineNumber>
<InvoiceLineReferences>
<OrderLineNumber>0</OrderLineNumber>
<BuyersOrderLineReference>R-48734</BuyersOrderLineReference>
</InvoiceLineReferences>
<OP:AdditionalInvoiceLineReferences xmlns:OP=”urn:schemas-bossfed-co-uk:OP-Invoice-v1″>
<OP:InvoiceLineReference ReferenceType=”SETFLG” ReferenceDesc=”Settlement Discount Flag”>
<OP:Reference>Y</OP:Reference>
</OP:InvoiceLineReference>
</OP:AdditionalInvoiceLineReferences>
<Product>
<SuppliersProductCode>KF20039</SuppliersProductCode>
<Description>Q CONNECT L/ARCH FILE PPRBACK A4 BLU</Description>
</Product>
<Quantity>
<Packsize>10</Packsize>
<Amount>60</Amount>
</Quantity>
<Price>
<UnitPrice>0</UnitPrice>
</Price>
<LineTax>
<TaxRate Code=”S”>17.50</TaxRate>
</LineTax>
<LineTotal>0</LineTotal>
</InvoiceLine>
<InvoiceLine>
<LineNumber>3</LineNumber>
<InvoiceLineReferences>
<OrderLineNumber>0</OrderLineNumber>
<BuyersOrderLineReference>R-48734</BuyersOrderLineReference>
</InvoiceLineReferences>
<OP:AdditionalInvoiceLineReferences xmlns:OP=”urn:schemas-bossfed-co-uk:OP-Invoice-v1″>
<OP:InvoiceLineReference ReferenceType=”SETFLG” ReferenceDesc=”Settlement Discount Flag”>
<OP:Reference>Y</OP:Reference>
</OP:InvoiceLineReference>
</OP:AdditionalInvoiceLineReferences>
<Product>
<SuppliersProductCode>KF01470</SuppliersProductCode>
<Description>Q CONNECT L/ARCH FILE PPR/BACK A4 YLW</Description>
</Product>
<Quantity>
<Packsize>10</Packsize>
<Amount>60</Amount>
</Quantity>
<Price>
<UnitPrice>0</UnitPrice>
</Price>
<LineTax>
<TaxRate Code=”S”>17.50</TaxRate>
</LineTax>
<LineTotal>0</LineTotal>
</InvoiceLine>
<Settlement>
<SettlementTerms>
<DaysFromInvoice>31</DaysFromInvoice>
</SettlementTerms>
<SettlementDiscount>
<PercentDiscount>
<Percentage>2.50</Percentage>
</PercentDiscount>
<AmountDiscount>
<Amount>59.45</Amount>
</AmountDiscount>
</SettlementDiscount>
</Settlement>
<TaxSubTotal>
<TaxRate Code=”S”>17.50</TaxRate>
<NumberOfLinesAtRate>3</NumberOfLinesAtRate>
<TotalValueAtRate>0</TotalValueAtRate>
<SettlementDiscountAtRate>0</SettlementDiscountAtRate>
<TaxableValueAtRate>0</TaxableValueAtRate>
<TaxAtRate>0</TaxAtRate>
<NetPaymentAtRate>00</NetPaymentAtRate>
<GrossPaymentAtRate>0</GrossPaymentAtRate>
<TaxCurrency>
<Currency Code=”GBP”>Sterling</Currency>
</TaxCurrency>
</TaxSubTotal>
<InvoiceTotal>
<NumberOfLines>3</NumberOfLines>
<NumberOfTaxRates>1</NumberOfTaxRates>
<LineValueTotal>0</LineValueTotal>
<SettlementDiscountTotal>0</SettlementDiscountTotal>
<TaxableTotal>0</TaxableTotal>
<TaxTotal>0</TaxTotal>
<NetPaymentTotal>0</NetPaymentTotal>
<GrossPaymentTotal>0</GrossPaymentTotal>
</InvoiceTotal>
</Invoice>
<TaxBatchTrailer>
<TaxRate Code=”S”>17.50</TaxRate>
<TotalValueAtRate>0</TotalValueAtRate>
<SettlementDiscountAtRate>0</SettlementDiscountAtRate>
<TaxableValueAtRate>0</TaxableValueAtRate>
<TaxAtRate>0</TaxAtRate>
<NetPaymentAtRate>0</NetPaymentAtRate>
<GrossPaymentAtRate>0</GrossPaymentAtRate>
<BatchNumber>118</BatchNumber>
<NumberOfInvoicesAtRate>2</NumberOfInvoicesAtRate>
<TaxCurrency>GBP</TaxCurrency>
</TaxBatchTrailer>
<InvoiceBatchTrailer>
<NumberOfInvoices>2</NumberOfInvoices>
<LineValueTotal>0</LineValueTotal>
<SettlementDiscountTotal>0</SettlementDiscountTotal>
<TaxableTotal>0</TaxableTotal>
<TaxTotal>0</TaxTotal>
<NetPaymentTotal>0</NetPaymentTotal>
<GrossPaymentTotal>0</GrossPaymentTotal>
<BatchNumber>118</BatchNumber>
<InvoiceCurrency>GBP</InvoiceCurrency>
</InvoiceBatchTrailer>
</InvoiceBatch>Outbound.
<biztalk_1>
<header>
<delivery>
<message>
<sent>2008-05-29T22:30:27</sent>
<subject>INVOICE</subject>
</message>
<to>
<address>TEST UK</address>
</to>
<from>
<address>Test Trading</address>
</from>
</delivery>
<manifest>
<document>
<name>INVOICE</name>
<description>BASDA eBIS-XML Invoice</description>
</document>
</manifest>
<batchtotals>
<nettotal>17119.59</nettotal>
<taxtotal>2921.02</taxtotal>
<grosstotal>20040.61</grosstotal>
</batchtotals>
</header>
<body>
<INVOICE>
<INVOICEHEAD INVOICETYPE=”INV” FUNCCODE=”FRM”>
<INVOICEDESC>Invoice</INVOICEDESC>
<FUNCDESC>Firm Invoice</FUNCDESC>
<CURRENCY CURRTYPE=”INV” CURRCODE=”GBP”>
<CURRTYPEDESC>Invoice Currency</CURRTYPEDESC>
<CURRCODESC>Sterling</CURRCODESC>
</CURRENCY>
</INVOICEHEAD>
<REFERENCE REFTYPE=”INV”>
<REFDESC>Invoice Reference Number</REFDESC>
<REFCODE>3089424</REFCODE>
</REFERENCE>
<REFERENCE REFTYPE=”ORD”>
<REFDESC>Order Reference Number</REFDESC>
<REFCODE>R-48759</REFCODE>
</REFERENCE>
<REFERENCE REFTYPE=”CUR”>
<REFDESC>Customer’s Reference</REFDESC>
<REFCODE>R-48759</REFCODE>
</REFERENCE>
<DATEINFO DATETYPE=”INV”>
<DATEDESC>Invoice Date</DATEDESC>
<DATE>2008-05-29</DATE>
</DATEINFO>
<DATEINFO DATETYPE=”TPD”>
<DATEDESC>Tax Point Date</DATEDESC>
<DATE>2008-05-29</DATE>
</DATEINFO>
<DATEINFO DATETYPE=”ORD”>
<DATEDESC>Order Date</DATEDESC>
<DATE>2008-05-29</DATE>
</DATEINFO>
<DATEINFO DATETYPE=”DED”>
<DATEDESC>Delivery Date</DATEDESC>
<DATE>2008-05-30</DATE>
</DATEINFO>
<SUPPLIER>
<PARTYCODE IDTYPE=”BCS”>
<IDDESC>Buyers Code for Supplier</IDDESC>
<IDCODE>0000001604</IDCODE>
</PARTYCODE>
<ADDRESS>
<NAME>#</NAME>
<STREET>#</STREET>
<CITY>#</CITY>
<STATE>#</STATE>
<POSTCODE>#</POSTCODE>
</ADDRESS>
</SUPPLIER>
<BUYER>
<PARTYCODE IDTYPE=”SCB”>
<IDDESC>Suppliers Code for Buyer</IDDESC>
<IDCODE>#</IDCODE>
</PARTYCODE>
<ADDRESS>
<NAME>#</NAME>
<STREET>#</STREET>
<CITY>#</CITY>
<STATE>#</STATE>
<POSTCODE>#</POSTCODE>
</ADDRESS>
</BUYER>
<DELIVERY>
<ADDRESS>
<NAME>#</NAME>
<STREET>#</STREET>
<STREET>#</STREET>
<STREET>#</STREET>
<STREET>#</STREET>
<POSTCODE>#</POSTCODE>
</ADDRESS>
</DELIVERY>
<INVOICETO>
<ADDRESS>
<NAME>#</NAME>
<STREET>#</STREET>
<CITY>#</CITY>
<STATE>#</STATE>
<POSTCODE>#</POSTCODE>
</ADDRESS>
</INVOICETO>
<INVOICELINE LINEACTION=”Add”>
<LINENO>1</LINENO>
<PRODUCT PRODCODETYPE=”SPC”>
<PRODCODEDESC>Supplier’s code</PRODCODEDESC>
<PRODNUM>KF04114</PRODNUM>
</PRODUCT>
<PRODUCT PRODCODETYPE=”BPC”>
<PRODCODEDESC>Buyer’s code</PRODCODEDESC>
<PRODNUM>KF04114</PRODNUM>
</PRODUCT>
<QUANTITY QTYCODE=”USR” QTYUOM=”1″>
<QTYCODESC>Quantity Invoiced</QTYCODESC>
<QUANTITYAMOUNT>3150</QUANTITYAMOUNT>
</QUANTITY>
<PRICE PRICETYPE=”SEL”>
<PRICEDESC>Selling Price</PRICEDESC>
<PRICEAMOUNT>0</PRICEAMOUNT>
</PRICE>
<LINETAX>
<TAXCODE>S</TAXCODE>
<TAXRATE>17.50</TAXRATE>
</LINETAX>
</INVOICELINE>
<TAXSUBTOTAL>
<TAXCODE>S</TAXCODE>
<TAXRATE>17.50</TAXRATE>
<RATENOLINES>1</RATENOLINES>
<RATELINETOT>14741.24</RATELINETOT>
<RATETAXBLVAL>14372.71</RATETAXBLVAL>
<RATETAXVAL>2515.22</RATETAXVAL>
<RATEGROSSPAY>17256.46</RATEGROSSPAY>
<CURRENCY CURRTYPE=”INV” CURRCODE=”GBP”>
<CURRTYPEDESC>Invoice Currency</CURRTYPEDESC>
<CURRCODESC>Sterling</CURRCODESC>
</CURRENCY>
</TAXSUBTOTAL>
<INVOICETOTAL>
<INVNOLINES>1</INVNOLINES>
<INVLINETOT>14741.24</INVLINETOT>
<INVSETTLDISC>0</INVSETTLDISC>
<INVTAXBLTOT>14372.71</INVTAXBLTOT>
<INVTAXTOT>2515.22</INVTAXTOT>
<INVGROSSPAY>17256.46</INVGROSSPAY>
</INVOICETOTAL>
</INVOICE>
<INVOICE>
<INVOICEHEAD INVOICETYPE=”INV” FUNCCODE=”FRM”>
<INVOICEDESC>Invoice</INVOICEDESC>
<FUNCDESC>Firm Invoice</FUNCDESC>
<CURRENCY CURRTYPE=”INV” CURRCODE=”GBP”>
<CURRTYPEDESC>Invoice Currency</CURRTYPEDESC>
<CURRCODESC>Sterling</CURRCODESC>
</CURRENCY>
</INVOICEHEAD>
<REFERENCE REFTYPE=”INV”>
<REFDESC>Invoice Reference Number</REFDESC>
<REFCODE>3089424</REFCODE>
</REFERENCE>
<REFERENCE REFTYPE=”ORD”>
<REFDESC>Order Reference Number</REFDESC>
<REFCODE>R-48759</REFCODE>
</REFERENCE>
<REFERENCE REFTYPE=”CUR”>
<REFDESC>Customer’s Reference</REFDESC>
<REFCODE>R-48759</REFCODE>
</REFERENCE>
<DATEINFO DATETYPE=”INV”>
<DATEDESC>Invoice Date</DATEDESC>
<DATE>2008-05-29</DATE>
</DATEINFO>
<DATEINFO DATETYPE=”TPD”>
<DATEDESC>Tax Point Date</DATEDESC>
<DATE>2008-05-29</DATE>
</DATEINFO>
<DATEINFO DATETYPE=”ORD”>
<DATEDESC>Order Date</DATEDESC>
<DATE>2008-05-29</DATE>
</DATEINFO>
<DATEINFO DATETYPE=”DED”>
<DATEDESC>Delivery Date</DATEDESC>
<DATE>2008-05-30</DATE>
</DATEINFO>
<SUPPLIER>
<PARTYCODE IDTYPE=”BCS”>
<IDDESC>Buyers Code for Supplier</IDDESC>
<IDCODE>0000001604</IDCODE>
</PARTYCODE>
<ADDRESS>
<NAME>#</NAME>
<STREET>#</STREET>
<CITY>#</CITY>
<STATE>#</STATE>
<POSTCODE>#</POSTCODE>
</ADDRESS>
</SUPPLIER>
<BUYER>
<PARTYCODE IDTYPE=”SCB”>
<IDDESC>Suppliers Code for Buyer</IDDESC>
<IDCODE>#</IDCODE>
</PARTYCODE>
<ADDRESS>
<NAME>#</NAME>
<STREET>#</STREET>
<CITY>#</CITY>
<STATE>#</STATE>
<POSTCODE>#</POSTCODE>
</ADDRESS>
</BUYER>
<DELIVERY>
<ADDRESS>
<NAME>#</NAME>
</ADDRESS>
</DELIVERY>
<INVOICETO>
<ADDRESS>
<NAME>#</NAME>
</ADDRESS>
</INVOICETO>
<INVOICELINE LINEACTION=”Add”>
<LINENO>1</LINENO>
<PRODUCT PRODCODETYPE=”SPC”>
<PRODCODEDESC>Supplier’s code</PRODCODEDESC>
<PRODNUM>KF04114</PRODNUM>
</PRODUCT>
<PRODUCT PRODCODETYPE=”BPC”>
<PRODCODEDESC>Buyer’s code</PRODCODEDESC>
<PRODNUM>KF04114</PRODNUM>
</PRODUCT>
<QUANTITY QTYCODE=”USR” QTYUOM=”10″>
<QTYCODESC>Quantity Invoiced</QTYCODESC>
<QUANTITYAMOUNT>120</QUANTITYAMOUNT>
</QUANTITY>
<PRICE PRICETYPE=”SEL”>
<PRICEDESC>Selling Price</PRICEDESC>
<PRICEAMOUNT>0</PRICEAMOUNT>
</PRICE>
<LINETAX>
<TAXCODE>S</TAXCODE>
<TAXRATE>17.50</TAXRATE>
</LINETAX>
</INVOICELINE>
<INVOICELINE LINEACTION=”Add”>
<LINENO>2</LINENO>
<PRODUCT PRODCODETYPE=”SPC”>
<PRODCODEDESC>Supplier’s code</PRODCODEDESC>
<PRODNUM>KF04114</PRODNUM>
</PRODUCT>
<PRODUCT PRODCODETYPE=”BPC”>
<PRODCODEDESC>Buyer’s code</PRODCODEDESC>
<PRODNUM>KF04114</PRODNUM>
</PRODUCT>
<QUANTITY QTYCODE=”USR” QTYUOM=”10″>
<QTYCODESC>Quantity Invoiced</QTYCODESC>
<QUANTITYAMOUNT>60</QUANTITYAMOUNT>
</QUANTITY>
<PRICE PRICETYPE=”SEL”>
<PRICEDESC>Selling Price</PRICEDESC>
<PRICEAMOUNT>0</PRICEAMOUNT>
</PRICE>
<LINETAX>
<TAXCODE>S</TAXCODE>
<TAXRATE>17.50</TAXRATE>
</LINETAX>
</INVOICELINE>
<INVOICELINE LINEACTION=”Add”>
<LINENO>3</LINENO>
<PRODUCT PRODCODETYPE=”SPC”>
<PRODCODEDESC>Supplier’s code</PRODCODEDESC>
<PRODNUM>KF04114</PRODNUM>
</PRODUCT>
<PRODUCT PRODCODETYPE=”BPC”>
<PRODCODEDESC>Buyer’s code</PRODCODEDESC>
<PRODNUM>KF04114</PRODNUM>
</PRODUCT>
<QUANTITY QTYCODE=”USR” QTYUOM=”10″>
<QTYCODESC>Quantity Invoiced</QTYCODESC>
<QUANTITYAMOUNT>60</QUANTITYAMOUNT>
</QUANTITY>
<PRICE PRICETYPE=”SEL”>
<PRICEDESC>Selling Price</PRICEDESC>
<PRICEAMOUNT>0</PRICEAMOUNT>
</PRICE>
<LINETAX>
<TAXCODE>S</TAXCODE>
<TAXRATE>17.50</TAXRATE>
</LINETAX>
</INVOICELINE>
<TAXSUBTOTAL>
<TAXCODE>S</TAXCODE>
<TAXRATE>17.50</TAXRATE>
<RATENOLINES>3</RATENOLINES>
<RATELINETOT>0</RATELINETOT>
<RATETAXBLVAL>0</RATETAXBLVAL>
<RATETAXVAL>0</RATETAXVAL>
<RATEGROSSPAY>0</RATEGROSSPAY>
<CURRENCY CURRTYPE=”INV” CURRCODE=”GBP”>
<CURRTYPEDESC>Invoice Currency</CURRTYPEDESC>
<CURRCODESC>Sterling</CURRCODESC>
</CURRENCY>
</TAXSUBTOTAL>
<INVOICETOTAL>
<INVNOLINES>3</INVNOLINES>
<INVLINETOT>0</INVLINETOT>
<INVSETTLDISC>0</INVSETTLDISC>
<INVTAXBLTOT>0</INVTAXBLTOT>
<INVTAXTOT>0</INVTAXTOT>
<INVGROSSPAY>0</INVGROSSPAY>
</INVOICETOTAL>
</INVOICE>
</body>
</biztalk_1>This is an example of what is happening.. as you can see because I am using inline XSLT the Buyers and Suppliers code are always the same in the outbound doc, along with the invoice references and dates etc… The price (not shown) are all working as the don’t use the Inline XSLT..
Thanks again
-
June 17, 2008 at 5:02 AM #19930
I’m getting confused… Do you have a short input file you could post? Also, can you post an example of what a correct output file would look like?
-
June 17, 2008 at 7:14 AM #19933
You could try Xslt Call template e.g.
Connect Invoice to INVOICE with a looping functoid
Add one scripting functoid for each reference node you wish to create, each will need its own name
<xsl:template name=”INVREF”>
<xsl:param name=”type” />
<xsl:param name=”desc” />
<xsl:param name=”code” />
<xsl:element name=”REFERENCE”>
<xsl:attribute name=”REFTYPE”>
<xsl:value-of select=”$type”/>
</xsl:attribute>
<xsl:element name=”REFDESC”>
<xsl:value-of select=”$desc” />
</xsl:element>
<xsl:element name=”REFCODE”>
<xsl:value-of select=”$code” />
</xsl:element>
</xsl:element>
</xsl:template>This template requires three parameters, the type, desc and code. Link the source node to the scripting functoid or hard-code the script input parameter.
-
June 18, 2008 at 6:37 AM #19947
Greg – is the inline XSLT really necessary?
I think the key was adding the looping functoid which creates the “for each” in the underlying xslt. This is what sets the context to allow him to get the subordinate data for each node, instead of getting the first nodes data each time.
-
June 18, 2008 at 10:58 PM #19951
The inline Xslt might not be necessary, but there is no input nodeset to iterate over with the for-each.
The input data comes from disparate nodes in the source and these nodes map to the same output field. This would normally be accomplished by connecting each input node to the output node, however the output is a structure requiring additional fields that are dependent on the input node context.
There is probably a way of doing this with lots of conditional and value mapping functoids, but the Xslt Call Template seemed like the easiest option
-
June 19, 2008 at 6:38 AM #19956
I am looking at the in and out structures trying to see what the issue is.
We have multiple invoices on the input and multiple invoices on the output. So there is a looping connection from Invoice to INVOICE. This tells the mapper, which generates XSLT, to put a “for each Invoice node on the input, create an output node of INVOICE”.
Second, he needs three iterations of the REFERENCE node in each INVOICE. Again this is accomplished with another looping functoid to REFERENCE. The input would be each node – BuyersOrderNumber, SuppliersInvoiceNumber, DeliveryNoteNumber. Looping does not require 1:1 loop matching, you can create output loop iterations with multiple disparate inputs to the looping functoid. (aside: You could even use a repeating node and a single field at the same time as input to a looping functoid, for example.)
The technique to control what happens in each iteration is by using a logical tied to everything that goes on that iteration. For example, “if BuyersOrderNumber is present” would be the logical test and then we would tile that logical to the the conditoinal mappers that populate the fields for this output iteration, such as REFTYPE, REFDISC, and REFCODE.
So this is how we do things with pure functoids. Six of one, half dozen of another. I can understand if you were doing more webservice oriented work, with
smaller, less complex messages, I can see where one would tend more
towards breezy, hand coded XSLT. Again the advantages of the mapper are picking the node from the tree view, which gets more important with EDI, where you have the same segment in different levels of a document. Also, with more time on the tool, you get use to laying out groups of functoids in a particular way that you can later recognize visually.Either way you do it, it’s a FUN challenge.
-
-
-
-
-
-
-
-
AuthorPosts
- The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.