 |
|
 |
|
|
 |
Mapping flat file of orders (one line for each order) to order XML with multiple items |
 |
 |
|
|
02-08-04 01:42 PM
Hi,
I'm setting up a mapping to transform a tab-delimited file of orders
and items to XML. I've setup an XML import for the tab-delimited file
so that I can perform the mapping. The first case I need help with is
when I have multiple lines of the source for one order and I want
those to become one order with multiple line items in my XML.
Here's a simplified example:
Format:Order ID|Name|SKU
1|Jeremy|12
1|Jeremy|15
2|Bob|14
2|Bob|19
3|Xavier|20
4|Jacob|25
I would like this to come out as:
<Orders>
<Order>
<OrderID>1</OrderID>
<Name>Jeremy</Name>
<LineItems>
<LineItem>
<SKU>12</SKU>
</LineItem>
<LineItem>
<SKU>15</SKU>
</LineItem>
</LineItems>
</Order>
<Order>
<OrderID>2</OrderID>
<Name>Bob</Name>
<LineItems>
<LineItem>
<SKU>14</SKU>
</LineItem>
<LineItem>
<SKU>19</SKU>
</LineItem>
</LineItems>
</Order>
<Order>
<OrderID>3</OrderID>
<Name>Xavier</Name>
<LineItems>
<LineItem>
<SKU>20</SKU>
</LineItem>
</LineItems>
</Order>
<Order>
<OrderID>4</OrderID>
<Name>Jacob</Name>
<LineItems>
<LineItem>
<SKU>25</SKU>
</LineItem>
</LineItems>
</Order>
Also, on each line of the flat file I have billing and shipping
information. This information needs to go into 2 Consumer records in
each order, each having a different Type (where Type is a field in
Consumer). I was able to accomplish this by doing two mappings.
First from my flat file to an intermediate format where billing and
shipping are two different records. Then using the looping functiod
to pull the billing and shipping records into the Consumer record.
The problems I saw were trying to create two distinct records of
Consumer, setting the Type based on which fields it was taking, and
then grouping the fields together. Is there a way I can do this in
one mapping? If so how?
Example input:
Format: Order ID|Billing Name|Shipping Name
1|Jeremy|Jeremy
2|Sam|Bill
3|Joan|Joan
Current Next Step:
<Orders>
<Order>
<OrderID>1</OrderID>
<Billing>
<Name>Jeremy</Name>
</Billing>
<Shipping>
<Name>Jeremy</Name>
</Shipping>
</Order>
<Order>
<OrderID>2</OrderID>
<Billing>
<Name>Sam</Name>
</Billing>
<Shipping>
<Name>Bill</Name>
</Shipping>
</Order>
<Order>
<OrderID>3</OrderID>
<Billing>
<Name>Joan</Name>
</Billing>
<Shipping>
<Name>Joan</Name>
</Shipping>
</Order>
This is finally mapped to:
<Orders>
<Order>
<OrderID>1</OrderID>
<Consumer Type="Billing">
<Name>Jeremy</Name>
</Consumer>
<Consumer Type="Shipping">
<Name>Jeremy</Name>
</Consumer>
</Order>
<Order>
<OrderID>2</OrderID>
<Consumer Type="Billing">
<Name>Sam</Name>
</Consumer>
<Consumer Type="Shipping">
<Name>Bill</Name>
</Consumer>
</Order>
<Order>
<OrderID>3</OrderID>
<Consumer Type="Billing">
<Name>Joan</Name>
</Consumer>
<Consumer Type="Shipping">
<Name>Joan</Name>
</Consumer>
</Order>
Thanks,
Jeremy
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Mapping flat file of orders (one line for each order) to order XML with multiple i |
 |
 |
|
|
02-08-04 01:42 PM
On 12 Jan 2004 19:28:56 -0800, jlukensmeyer@yahoo.com (Jeremy
Lukensmeyer) wrote:
Could you post your documentspecifications and a test-input.example?
>Hi,
>
>I'm setting up a mapping to transform a tab-delimited file of orders
>and items to XML. I've setup an XML import for the tab-delimited file
>so that I can perform the mapping. The first case I need help with is
>when I have multiple lines of the source for one order and I want
>those to become one order with multiple line items in my XML.
>
>Here's a simplified example:
>Format:Order ID|Name|SKU
>1|Jeremy|12
>1|Jeremy|15
>2|Bob|14
>2|Bob|19
>3|Xavier|20
>4|Jacob|25
>
>I would like this to come out as:
><Orders>
> <Order>
> <OrderID>1</OrderID>
> <Name>Jeremy</Name>
> <LineItems>
> <LineItem>
> <SKU>12</SKU>
> </LineItem>
> <LineItem>
> <SKU>15</SKU>
> </LineItem>
> </LineItems>
> </Order>
> <Order>
> <OrderID>2</OrderID>
> <Name>Bob</Name>
> <LineItems>
> <LineItem>
> <SKU>14</SKU>
> </LineItem>
> <LineItem>
> <SKU>19</SKU>
> </LineItem>
> </LineItems>
> </Order>
> <Order>
> <OrderID>3</OrderID>
> <Name>Xavier</Name>
> <LineItems>
> <LineItem>
> <SKU>20</SKU>
> </LineItem>
> </LineItems>
> </Order>
> <Order>
> <OrderID>4</OrderID>
> <Name>Jacob</Name>
> <LineItems>
> <LineItem>
> <SKU>25</SKU>
> </LineItem>
> </LineItems>
> </Order>
>
>Also, on each line of the flat file I have billing and shipping
>information. This information needs to go into 2 Consumer records in
>each order, each having a different Type (where Type is a field in
>Consumer). I was able to accomplish this by doing two mappings.
>First from my flat file to an intermediate format where billing and
>shipping are two different records. Then using the looping functiod
>to pull the billing and shipping records into the Consumer record.
>The problems I saw were trying to create two distinct records of
>Consumer, setting the Type based on which fields it was taking, and
>then grouping the fields together. Is there a way I can do this in
>one mapping? If so how?
>
>Example input:
>Format: Order ID|Billing Name|Shipping Name
>1|Jeremy|Jeremy
>2|Sam|Bill
>3|Joan|Joan
>
>Current Next Step:
><Orders>
><Order>
> <OrderID>1</OrderID>
> <Billing>
> <Name>Jeremy</Name>
> </Billing>
> <Shipping>
> <Name>Jeremy</Name>
> </Shipping>
></Order>
><Order>
> <OrderID>2</OrderID>
> <Billing>
> <Name>Sam</Name>
> </Billing>
> <Shipping>
> <Name>Bill</Name>
> </Shipping>
></Order>
><Order>
> <OrderID>3</OrderID>
> <Billing>
> <Name>Joan</Name>
> </Billing>
> <Shipping>
> <Name>Joan</Name>
> </Shipping>
></Order>
>
>This is finally mapped to:
><Orders>
> <Order>
> <OrderID>1</OrderID>
> <Consumer Type="Billing">
> <Name>Jeremy</Name>
> </Consumer>
> <Consumer Type="Shipping">
> <Name>Jeremy</Name>
> </Consumer>
> </Order>
> <Order>
> <OrderID>2</OrderID>
> <Consumer Type="Billing">
> <Name>Sam</Name>
> </Consumer>
> <Consumer Type="Shipping">
> <Name>Bill</Name>
> </Consumer>
> </Order>
> <Order>
> <OrderID>3</OrderID>
> <Consumer Type="Billing">
> <Name>Joan</Name>
> </Consumer>
> <Consumer Type="Shipping">
> <Name>Joan</Name>
> </Consumer>
> </Order>
>
>
>Thanks,
>
>Jeremy
--
Jan Eliasen, representing himself and not the company he works for.
MCP in Microsoft BizTalk Server
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Mapping flat file of orders (one line for each order) to order XML with multiple i |
 |
 |
|
|
02-08-04 01:42 PM
Below are an example, the doc specs, and my current transformations.
(I trimmed some of the final spec out because I can't release it
completely.)
Thanks again,
Jeremy
Here's the sample input - tab delimited - EOL for end of line
order-id order-item-id purchase-date payments-date buyer-email buyer-name bu
yer-phone-number sku product-name quantity-purchased item-price item-tax shi
pping-price shipping-tax ship-service-level recepient-name ship-address-1 sh
ip-address-2 ship-address-3
ship-city ship-state ship-postal-code ship-countryEOL
058-3529793-7149164 23859249200062 2003-12-11T12:43:20-08:00 2003-12-11T15:06:10-08:00 [ema
il]test@test.com[/email] Tester
Testing 123-123-1234 A203 Os Asian Fusion
Vinaigrette 1 30 0 5.5 0 Standard Sam Jones 1 Fourth Street San
Rafael CA 94901 USEOL
058-3529793-7149164 58748177283414 2003-12-11T12:43:20-08:00 2003-12-11T15:06:10-08:00 [ema
il]test@test.com[/email] Tester
Testing 123-123-1234 A205 Os Thai Fusion
Vinaigrette 1 30 0 5.5 0 Standard Sam Jones 1 Fourth Street San
Rafael CA 94901 USEOL
058-9975897-6507554 55890343065094 2003-12-11T12:43:20-08:00 2003-12-11T15:06:25-08:00 [ema
il]test@test.com[/email] Tester
Testing 123-123-1234 A204 Os World Fusion
Vinaigrette 1 30 0 8 0 Standard Tester Test 1 Alpine St. San
Rafael CA 94901 USEOL
Schema for this format:
<?xml version="1.0"?>
<!-- Generated by using BizTalk Editor on Thu, Dec 04 2003 04:50:33 PM
-->
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<Schema name="AmazonOrders" b:BizTalkServerEditorTool_Version="1.5"
b:root_reference="AmazonOrders" b:def_record_delim="0xa"
b:def_field_delim="0x9" b:standard="CUSTOM"
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:d="urn:schemas-microsoft-com:datatypes">
<b:SelectionFields/>
<ElementType name="Order" content="empty" model="closed">
<b:RecordInfo structure="delimited" delimiter_type="inherit_field"
field_order="infix"/>
<AttributeType name="Sku" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShippingTax" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShippingPrice" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipState" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipServiceLevel">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipPostalCode" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipCountry" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipCity" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipAddress3" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipAddress2" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipAddress1" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="RecipientName" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="QuantityPurchased" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="PurchaseDate" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ProductName" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="PaymentsDate" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="OrderItemId" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="OrderId" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ItemTax" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ItemPrice" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="BuyerPhoneNumber" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="BuyerName" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="BuyerEmail" d:type="string">
<b:FieldInfo/></AttributeType>
<attribute type="OrderId" required="no"/>
<attribute type="OrderItemId" required="no"/>
<attribute type="PurchaseDate" required="no"/>
<attribute type="PaymentsDate" required="no"/>
<attribute type="BuyerEmail" required="no"/>
<attribute type="BuyerName" required="no"/>
<attribute type="BuyerPhoneNumber" required="no"/>
<attribute type="Sku" required="no"/>
<attribute type="ProductName" required="no"/>
<attribute type="QuantityPurchased" required="no"/>
<attribute type="ItemPrice" required="no"/>
<attribute type="ItemTax" required="no"/>
<attribute type="ShippingPrice" required="no"/>
<attribute type="ShippingTax" required="no"/>
<attribute type="ShipServiceLevel" required="no"/>
<attribute type="RecipientName" required="no"/>
<attribute type="ShipAddress1" required="no"/>
<attribute type="ShipAddress2" required="no"/>
<attribute type="ShipAddress3" required="no"/>
<attribute type="ShipCity" required="no"/>
<attribute type="ShipState" required="no"/>
<attribute type="ShipPostalCode" required="no"/>
<attribute type="ShipCountry" required="no"/>
</ElementType><ElementType name="AmazonOrders" content="eltOnly"
model="closed">
<b:RecordInfo structure="delimited" delimiter_type="inherit_record"
field_order="postfix" skip_LF="no"/>
<element type="Order" maxOccurs="*" minOccurs="1"/>
</ElementType></Schema>
Mapping to the middle step:
<?xml version="1.0"?>
<!-- Generated using BizTalk Mapper on Mon, Jan 12 2004 05:10:01 PM
-->
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<mapsource Name="BizTalk Map" BizTalkServerMapperTool_Version="1.5"
Version="1.5" XRange="100" YRange="420"><SrcTree><Schema
name="AmazonOrders" b:BizTalkServerEditorTool_Version="1.5"
b:root_reference="AmazonOrders" b:def_record_delim="0xa"
b:def_field_delim="0x9" b:standard="CUSTOM"
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:d="urn:schemas-microsoft-com:datatypes">
<b:SelectionFields/>
<ElementType name="Order" content="empty" model="closed">
<b:RecordInfo structure="delimited" delimiter_type="inherit_field"
field_order="infix"/>
<AttributeType name="Sku" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShippingTax" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShippingPrice" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipState" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipServiceLevel">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipPostalCode" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipCountry" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipCity" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipAddress3" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipAddress2" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipAddress1" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="RecipientName" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="QuantityPurchased" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="PurchaseDate" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ProductName" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="PaymentsDate" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="OrderItemId" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="OrderId" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ItemTax" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ItemPrice" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="BuyerPhoneNumber" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="BuyerName" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="BuyerEmail" d:type="string">
<b:FieldInfo/></AttributeType>
<attribute type="OrderId" required="no"/>
<attribute type="OrderItemId" required="no"/>
<attribute type="PurchaseDate" required="no"/>
<attribute type="PaymentsDate" required="no"/>
<attribute type="BuyerEmail" required="no"/>
<attribute type="BuyerName" required="no"/>
<attribute type="BuyerPhoneNumber" required="no"/>
<attribute type="Sku" required="no"/>
<attribute type="ProductName" required="no"/>
<attribute type="QuantityPurchased" required="no"/>
<attribute type="ItemPrice" required="no"/>
<attribute type="ItemTax" required="no"/>
<attribute type="ShippingPrice" required="no"/>
<attribute type="ShippingTax" required="no"/>
<attribute type="ShipServiceLevel" required="no"/>
<attribute type="RecipientName" required="no"/>
<attribute type="ShipAddress1" required="no"/>
<attribute type="ShipAddress2" required="no"/>
<attribute type="ShipAddress3" required="no"/>
<attribute type="ShipCity" required="no"/>
<attribute type="ShipState" required="no"/>
<attribute type="ShipPostalCode" required="no"/>
<attribute type="ShipCountry" required="no"/>
</ElementType><ElementType name="AmazonOrders" content="eltOnly"
model="closed">
<b:RecordInfo structure="delimited"
delimiter_type="inherit_record" field_order="postfix" skip_LF="no"/>
<element type="Order" maxOccurs="*" minOccurs="1"/>
</ElementType></Schema>
</SrcTree><TrgTree><Schema name="AmazonOrders"
b:BizTalkServerEditorTool_Version="1.5"
b:root_reference="AmazonOrders" b:standard="XML"
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:d="urn:schemas-microsoft-com:datatypes">
<b:SelectionFields/>
<ElementType name="Shipping" content="eltOnly" model="closed">
<b:RecordInfo/>
<AttributeType name="Phone">
<b:FieldInfo/></AttributeType>
<AttributeType name="Name">
<b:FieldInfo/></AttributeType>
<AttributeType name="Email">
<b:FieldInfo/></AttributeType>
<element type="Address" maxOccurs="1" minOccurs="0"/>
<attribute type="Name" required="no"/>
<attribute type="Phone" required="no"/>
<attribute type="Email" required="no"/>
</ElementType><ElementType name="OrderItems" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="OrderItem" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="OrderItem" content="empty"
model="closed">
<b:RecordInfo/>
<AttributeType name="Sku" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="QuantityPurchased" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ProductName" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ItemPrice" d:type="r4">
<b:FieldInfo/></AttributeType>
<attribute type="ItemPrice" required="no"/>
<attribute type="QuantityPurchased" required="no"/>
<attribute type="ProductName" required="no"/>
<attribute type="Sku" required="no"/>
</ElementType><ElementType name="Order" content="eltOnly"
model="closed">
<b:RecordInfo/>
<AttributeType name="ShippingPrice" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipServiceLevel">
<b:FieldInfo/></AttributeType>
<AttributeType name="PurchaseDate" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="OrderTax" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="OrderId" d:type="string">
<b:FieldInfo/></AttributeType>
<attribute type="OrderId" required="no"/>
<attribute type="PurchaseDate" required="no"/>
<attribute type="ShippingPrice" required="no"/>
<attribute type="OrderTax" required="no"/>
<attribute type="ShipServiceLevel" required="no"/>
<element type="Billing" maxOccurs="1" minOccurs="0"/>
<element type="Shipping" maxOccurs="1" minOccurs="0"/>
<element type="OrderItems" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="Customer" content="empty"
model="closed">
<b:RecordInfo/>
<AttributeType name="OrderSource">
<b:FieldInfo/></AttributeType>
<AttributeType name="CustomerID">
<b:FieldInfo/></AttributeType>
<attribute type="CustomerID" required="no"/>
<attribute type="OrderSource" required="no"/>
</ElementType><ElementType name="Billing" content="eltOnly"
model="closed">
<b:RecordInfo/>
<AttributeType name="Phone">
<b:FieldInfo/></AttributeType>
<AttributeType name="Name">
<b:FieldInfo/></AttributeType>
<AttributeType name="Email">
<b:FieldInfo/></AttributeType>
<element type="Address" maxOccurs="1" minOccurs="0"/>
<attribute type="Name" required="no"/>
<attribute type="Phone" required="no"/>
<attribute type="Email" required="no"/>
</ElementType><ElementType name="AmazonOrders" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="Order" maxOccurs="*" minOccurs="1"/>
<element type="Customer" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="Address" content="empty"
model="closed">
<b:RecordInfo/>
<AttributeType name="State">
<b:FieldInfo/></AttributeType>
<AttributeType name="PostalCode">
<b:FieldInfo/></AttributeType>
<AttributeType name="Country">
<b:FieldInfo/></AttributeType>
<AttributeType name="City">
<b:FieldInfo/></AttributeType>
<AttributeType name="Address3">
<b:FieldInfo/></AttributeType>
<AttributeType name="Address2">
<b:FieldInfo/></AttributeType>
<AttributeType name="Address1">
<b:FieldInfo/></AttributeType>
<attribute type="Address1" required="no"/>
<attribute type="Address2" required="no"/>
<attribute type="Address3" required="no"/>
<attribute type="City" required="no"/>
<attribute type="State" required="no"/>
<attribute type="PostalCode" required="no"/>
<attribute type="Country" required="no"/>
</ElementType></Schema>
</TrgTree><TreeValues><ConstantValues><Value value="DefaultOrderType"
Query="/AmazonOrders/Customer/@OrderSource"/><Value
value="EnterCustomerIDHere"
Query="/AmazonOrders/Customer/@CustomerID"/></ConstantValues>
</TreeValues><Pages><Page Name="Page 1"><Links><Link LinkID="1"
LinkFrom="/AmazonOrders/Order/@OrderId"
LinkTo="/AmazonOrders/Order/@OrderId"/><Link LinkID="2"
LinkFrom="/AmazonOrders/Order/@PurchaseDate"
LinkTo="/AmazonOrders/Order/@PurchaseDate"/><Link LinkID="3"
LinkFrom="/AmazonOrders/Order/@ShippingPrice"
LinkTo="/AmazonOrders/Order/@ShippingPrice"/><Link LinkID="4"
LinkFrom="/AmazonOrders/Order/@ShipServiceLevel"
LinkTo="/AmazonOrders/Order/@ShipServiceLevel"/><Link LinkID="5"
LinkFrom="/AmazonOrders/Order/@RecipientName"
LinkTo="/AmazonOrders/Order/Shipping/@Name"/><Link LinkID="6"
LinkFrom="/AmazonOrders/Order/@BuyerName"
LinkTo="/AmazonOrders/Order/Billing/@Name"/><Link LinkID="7"
LinkFrom="/AmazonOrders/Order/@BuyerEmail"
LinkTo="/AmazonOrders/Order/Billing/@Email"/><Link LinkID="8"
LinkFrom="/AmazonOrders/Order/@BuyerPhoneNumber"
LinkTo="/AmazonOrders/Order/Billing/@Phone"/><Link LinkID="9"
LinkFrom="/AmazonOrders/Order/@ShipAddress1"
LinkTo="/AmazonOrders/Order/Billing/Address/@Address1"/><Link
LinkID="10" LinkFrom="/AmazonOrders/Order/@ShipAddress2"
LinkTo="/AmazonOrders/Order/Billing/Address/@Address2"/><Link
LinkID="11" LinkFrom="/AmazonOrders/Order/@ShipAddress3"
LinkTo="/AmazonOrders/Order/Billing/Address/@Address3"/><Link
LinkID="12" LinkFrom="/AmazonOrders/Order/@ShipCity"
LinkTo="/AmazonOrders/Order/Billing/Address/@City"/><Link LinkID="13"
LinkFrom="/AmazonOrders/Order/@ShipState"
LinkTo="/AmazonOrders/Order/Billing/Address/@State"/><Link LinkID="14"
LinkFrom="/AmazonOrders/Order/@ShipPostalCode"
LinkTo="/AmazonOrders/Order/Billing/Address/@PostalCode"/><Link
LinkID="15" LinkFrom="/AmazonOrders/Order/@ShipCountry"
LinkTo="/AmazonOrders/Order/Billing/Address/@Country"/><Link
LinkID="16" LinkFrom="/AmazonOrders/Order/@ShipAddress1"
LinkTo="/AmazonOrders/Order/Shipping/Address/@Address1"/><Link
LinkID="17" LinkFrom="/AmazonOrders/Order/@ShipAddress2"
LinkTo="/AmazonOrders/Order/Shipping/Address/@Address2"/><Link
LinkID="18" LinkFrom="/AmazonOrders/Order/@ShipAddress3"
LinkTo="/AmazonOrders/Order/Shipping/Address/@Address3"/><Link
LinkID="19" LinkFrom="/AmazonOrders/Order/@ShipCity"
LinkTo="/AmazonOrders/Order/Shipping/Address/@City"/><Link LinkID="20"
LinkFrom="/AmazonOrders/Order/@ShipState"
LinkTo="/AmazonOrders/Order/Shipping/Address/@State"/><Link
LinkID="21" LinkFrom="/AmazonOrders/Order/@ShipPostalCode"
LinkTo="/AmazonOrders/Order/Shipping/Address/@PostalCode"/><Link
LinkID="22" LinkFrom="/AmazonOrders/Order/@ShipCountry"
LinkTo="/AmazonOrders/Order/Shipping/Address/@Country"/><Link
LinkID="23" LinkFrom="/AmazonOrders/Order/@BuyerEmail"
LinkTo="/AmazonOrders/Order/Shipping/@Email"/><Link LinkID="24"
LinkFrom="/AmazonOrders/Order/@BuyerPhoneNumber"
LinkTo="/AmazonOrders/Order/Shipping/@Phone"/><Link LinkID="25"
LinkFrom="/AmazonOrders/Order/@Sku"
LinkTo="/AmazonOrders/Order/OrderItems/OrderItem/@Sku"/><Link
LinkID="26" LinkFrom="/AmazonOrders/Order/@ProductName"
LinkTo="/AmazonOrders/Order/OrderItems/OrderItem/@ProductName"/><Link
LinkID="27" LinkFrom="/AmazonOrders/Order/@QuantityPurchased"
LinkTo="/AmazonOrders/Order/OrderItems/OrderItem/@QuantityPurchased"/><Link
LinkID="28" LinkFrom="/AmazonOrders/Order/@ItemPrice"
LinkTo="/AmazonOrders/Order/OrderItems/OrderItem/@ItemPrice"/><Link
LinkID="29" LinkFrom="/AmazonOrders/Order/@ItemTax" LinkTo="1"/><Link
LinkID="30" LinkFrom="/AmazonOrders/Order/@ShippingTax"
LinkTo="1"/><Link LinkID="31" LinkFrom="1"
LinkTo="/AmazonOrders/Order/@OrderTax"/></Links><Functoids><Functoid
FunctoidID="1" X-Cell="53" Y-Cell="219" Functoid-FID="118"
Functoid-Version="1" Script-Functoid="no"><Input-Parameters><Parameter
Type="Link" Value="29"/><Parameter Type="Link"
Value="30"/></Input-Parameters></Functoid></Functoids></Page></Pages><Compil
edXSL><xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="urn:var"
xmlns:userVBScript="urn:userVBScript"
xmlns:userJScript="urn:userJScript" exclude-result-prefixes="msxsl var
userVBScript userJScript" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="AmazonOrders"/>
</xsl:template>
<xsl:template match="AmazonOrders">
<AmazonOrders>
<xsl:for-each select="Order">
<Order>
<xsl:if test="@OrderId"><xsl:attribute
name="OrderId"><xsl:value-of
select="@OrderId"/></xsl:attribute></xsl:if>
<xsl:if test="@PurchaseDate"><xsl:attribute
name="PurchaseDate"><xsl:value-of
select="@PurchaseDate"/></xsl:attribute></xsl:if>
<xsl:if test="@ShippingPrice"><xsl:attribute
name="ShippingPrice"><xsl:value-of
select="@ShippingPrice"/></xsl:attribute></xsl:if>
<xsl:variable name="var:v1"
select=" uservbscript :fctmathadd2(string(@ItemTax
),string(@ShippingTax))"/>
<xsl:attribute name="OrderTax"><xsl:value-of
select="$var:v1"/></xsl:attribute>
<xsl:if test="@ShipServiceLevel"><xsl:attribute
name="ShipServiceLevel"><xsl:value-of
select="@ShipServiceLevel"/></xsl:attribute></xsl:if>
<Billing>
<xsl:if test="@BuyerName"><xsl:attribute
name="Name"><xsl:value-of
select="@BuyerName"/></xsl:attribute></xsl:if>
<xsl:if test="@BuyerPhoneNumber"><xsl:attribute
name="Phone"><xsl:value-of
select="@BuyerPhoneNumber"/></xsl:attribute></xsl:if>
<xsl:if test="@BuyerEmail"><xsl:attribute
name="Email"><xsl:value-of
select="@BuyerEmail"/></xsl:attribute></xsl:if>
<Address>
<xsl:if test="@ShipAddress1"><xsl:attribute
name="Address1"><xsl:value-of
select="@ShipAddress1"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipAddress2"><xsl:attribute
name="Address2"><xsl:value-of
select="@ShipAddress2"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipAddress3"><xsl:attribute
name="Address3"><xsl:value-of
select="@ShipAddress3"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipCity"><xsl:attribute
name="City"><xsl:value-of
select="@ShipCity"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipState"><xsl:attribute
name="State"><xsl:value-of
select="@ShipState"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipPostalCode"><xsl:attribute
name="PostalCode"><xsl:value-of
select="@ShipPostalCode"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipCountry"><xsl:attribute
name="Country"><xsl:value-of
select="@ShipCountry"/></xsl:attribute></xsl:if>
</Address>
</Billing>
<Shipping>
<xsl:if test="@RecipientName"><xsl:attribute
name="Name"><xsl:value-of
select="@RecipientName"/></xsl:attribute></xsl:if>
<xsl:if test="@BuyerPhoneNumber"><xsl:attribute
name="Phone"><xsl:value-of
select="@BuyerPhoneNumber"/></xsl:attribute></xsl:if>
<xsl:if test="@BuyerEmail"><xsl:attribute
name="Email"><xsl:value-of
select="@BuyerEmail"/></xsl:attribute></xsl:if>
<Address>
<xsl:if test="@ShipAddress1"><xsl:attribute
name="Address1"><xsl:value-of
select="@ShipAddress1"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipAddress2"><xsl:attribute
name="Address2"><xsl:value-of
select="@ShipAddress2"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipAddress3"><xsl:attribute
name="Address3"><xsl:value-of
select="@ShipAddress3"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipCity"><xsl:attribute
name="City"><xsl:value-of
select="@ShipCity"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipState"><xsl:attribute
name="State"><xsl:value-of
select="@ShipState"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipPostalCode"><xsl:attribute
name="PostalCode"><xsl:value-of
select="@ShipPostalCode"/></xsl:attribute></xsl:if>
<xsl:if test="@ShipCountry"><xsl:attribute
name="Country"><xsl:value-of
select="@ShipCountry"/></xsl:attribute></xsl:if>
</Address>
</Shipping>
<OrderItems>
<OrderItem>
<xsl:if test="@ItemPrice"><xsl:attribute
name="ItemPrice"><xsl:value-of
select="@ItemPrice"/></xsl:attribute></xsl:if>
<xsl:if test="@QuantityPurchased"><xsl:attribute
name="QuantityPurchased"><xsl:value-of
select="@QuantityPurchased"/></xsl:attribute></xsl:if>
<xsl:if test="@ProductName"><xsl:attribute
name="ProductName"><xsl:value-of
select="@ProductName"/></xsl:attribute></xsl:if>
<xsl:if test="@Sku"><xsl:attribute name="Sku"><xsl:value-of
select="@Sku"/></xsl:attribute></xsl:if>
</OrderItem>
</OrderItems>
</Order>
</xsl:for-each>
<Customer>
<xsl:attribute
name="CustomerID">EnterCustomerIDHere</xsl:attribute>
<xsl:attribute
name="OrderSource">DefaultOrderType</xsl:attribute>
</Customer>
</AmazonOrders>
</xsl:template>
<msxsl:script language="VBScript" implements-prefix="userVBScript">
<![CDATA[
Function FctMathAdd2( p_strParm0, p_strParm1 )
If ( IsNumeric( p_strParm0 ) And IsNumeric( p_strParm1 ) ) Then
FctMathAdd2 = CDbl( p_strParm0 ) + CDbl( p_strParm1 )
Else
FctMathAdd2 = ""
End If
End Function
]]>
</msxsl:script>
</xsl:stylesheet>
</CompiledXSL></mapsource>
Mapping to the final version:
<?xml version="1.0" encoding="utf-16"?>
<!-- Generated using BizTalk Mapper on Mon, Jan 12 2004 06:31:46 PM
-->
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<mapsource Name="BizTalk Map" BizTalkServerMapperTool_Version="1.5"
Version="1.5" XRange="100" YRange="420"><SrcTree><Schema
name="AmazonOrders" b:BizTalkServerEditorTool_Version="1.5"
b:root_reference="AmazonOrders" b:standard="XML"
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:d="urn:schemas-microsoft-com:datatypes">
<b:SelectionFields/>
<ElementType name="Shipping" content="eltOnly" model="closed">
<b:RecordInfo/>
<AttributeType name="Phone">
<b:FieldInfo/></AttributeType>
<AttributeType name="Name">
<b:FieldInfo/></AttributeType>
<AttributeType name="Email">
<b:FieldInfo/></AttributeType>
<element type="Address" maxOccurs="1" minOccurs="0"/>
<attribute type="Name" required="no"/>
<attribute type="Phone" required="no"/>
<attribute type="Email" required="no"/>
</ElementType><ElementType name="OrderItems" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="OrderItem" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="OrderItem" content="empty"
model="closed">
<b:RecordInfo/>
<AttributeType name="Sku" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="QuantityPurchased" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ProductName" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ItemPrice" d:type="r4">
<b:FieldInfo/></AttributeType>
<attribute type="ItemPrice" required="no"/>
<attribute type="QuantityPurchased" required="no"/>
<attribute type="ProductName" required="no"/>
<attribute type="Sku" required="no"/>
</ElementType><ElementType name="Order" content="eltOnly"
model="closed">
<b:RecordInfo/>
<AttributeType name="ShippingPrice" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipServiceLevel">
<b:FieldInfo/></AttributeType>
<AttributeType name="PurchaseDate" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="OrderTax" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="OrderId" d:type="string">
<b:FieldInfo/></AttributeType>
<attribute type="OrderId" required="no"/>
<attribute type="PurchaseDate" required="no"/>
<attribute type="ShippingPrice" required="no"/>
<attribute type="OrderTax" required="no"/>
<attribute type="ShipServiceLevel" required="no"/>
<element type="Billing" maxOccurs="1" minOccurs="0"/>
<element type="Shipping" maxOccurs="1" minOccurs="0"/>
<element type="OrderItems" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="Customer" content="empty"
model="closed">
<b:RecordInfo/>
<AttributeType name="OrderSource">
<b:FieldInfo/></AttributeType>
<AttributeType name="CustomerID">
<b:FieldInfo/></AttributeType>
<attribute type="CustomerID" required="no"/>
<attribute type="OrderSource" required="no"/>
</ElementType><ElementType name="Billing" content="eltOnly"
model="closed">
<b:RecordInfo/>
<AttributeType name="Phone">
<b:FieldInfo/></AttributeType>
<AttributeType name="Name">
<b:FieldInfo/></AttributeType>
<AttributeType name="Email">
<b:FieldInfo/></AttributeType>
<element type="Address" maxOccurs="1" minOccurs="0"/>
<attribute type="Name" required="no"/>
<attribute type="Phone" required="no"/>
<attribute type="Email" required="no"/>
</ElementType><ElementType name="AmazonOrders" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="Order" maxOccurs="*" minOccurs="1"/>
<element type="Customer" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="Address" content="empty"
model="closed">
<b:RecordInfo/>
<AttributeType name="State">
<b:FieldInfo/></AttributeType>
<AttributeType name="PostalCode">
<b:FieldInfo/></AttributeType>
<AttributeType name="Country">
<b:FieldInfo/></AttributeType>
<AttributeType name="City">
<b:FieldInfo/></AttributeType>
<AttributeType name="Address3">
<b:FieldInfo/></AttributeType>
<AttributeType name="Address2">
<b:FieldInfo/></AttributeType>
<AttributeType name="Address1">
<b:FieldInfo/></AttributeType>
<attribute type="Address1" required="no"/>
<attribute type="Address2" required="no"/>
<attribute type="Address3" required="no"/>
<attribute type="City" required="no"/>
<attribute type="State" required="no"/>
<attribute type="PostalCode" required="no"/>
<attribute type="Country" required="no"/>
</ElementType></Schema>
</SrcTree><TrgTree><Schema name="submitOrderBatch"
b:BizTalkServerEditorTool_Version="1.5"
b:root_reference="submitOrderBatch" b:standard="XML"
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:d="urn:schemas-microsoft-com:datatypes">
<b:SelectionFields/>
<ElementType name="submitOrderBatch" content="eltOnly" order="seq"
model="closed">
<b:RecordInfo/>
<AttributeType name="CustomerBatchID">
<b:FieldInfo/></AttributeType>
<element type="Customer" maxOccurs="1" minOccurs="1"/>
<element type="Orders" maxOccurs="1" minOccurs="1"/>
<attribute type="CustomerBatchID" required="yes"/>
</ElementType><ElementType name="Zip" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Vintage" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="State" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="ShippingPriority"
content="textOnly" model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="ShippingInstructions"
content="textOnly" model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="SalespersonName"
content="textOnly" model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="RetailPrice" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Rebate" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Quantity" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="PromotionCode" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Product" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="CustomerSKU" maxOccurs="1" minOccurs="1"/>
<element type="Description" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="Phone" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Orders" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="Order" maxOccurs="*" minOccurs="1"/>
</ElementType><ElementType name="OrderTotal" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="OrderShipping" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="ConsumerShippingCharge" maxOccurs="1"
minOccurs="1"/>
<element type="ShippingPriority" maxOccurs="1" minOccurs="0"/>
<element type="ShippingInstructions" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="OrderSalesTax" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="OrderLines" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="OrderLine" maxOccurs="*" minOccurs="1"/>
</ElementType><ElementType name="OrderLine" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="LineNumber" maxOccurs="1" minOccurs="1"/>
<element type="Quantity" maxOccurs="1" minOccurs="1"/>
<element type="Product" maxOccurs="1" minOccurs="1"/>
<element type="LineSubtotal" maxOccurs="1" minOccurs="1"/>
</ElementType><ElementType name="OrderHeaderMisc" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="GiftMessage" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="OrderHeader" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="OrderDate" maxOccurs="1" minOccurs="0"/>
<element type="Consumer" maxOccurs="*" minOccurs="1"/>
<element type="ConsumerHandlingFee" maxOccurs="1" minOccurs="1"/>
<element type="OrderShipping" maxOccurs="1" minOccurs="1"/>
<element type="OrderSalesTax" maxOccurs="1" minOccurs="1"/>
<element type="BottleDeposit" maxOccurs="1" minOccurs="1"/>
<element type="OrderTotal" maxOccurs="1" minOccurs="1"/>
<element type="Rebate" maxOccurs="1" minOccurs="0"/>
<element type="PromotionCode" maxOccurs="1" minOccurs="0"/>
<element type="OrderHeaderMisc" maxOccurs="1" minOccurs="0"/>
<element type="ConsumerInsurance" maxOccurs="1" minOccurs="1"/>
<element type="Card" maxOccurs="1" minOccurs="0"/>
<element type="SalespersonName" maxOccurs="1" minOccurs="0"/>
<element type="App1" maxOccurs="*" minOccurs="0"/>
<element type="App2" maxOccurs="*" minOccurs="0"/>
<element type="App3" maxOccurs="*" minOccurs="0"/>
</ElementType><ElementType name="OrderDate" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Order" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<AttributeType name="OrderType">
<b:FieldInfo/></AttributeType>
<AttributeType name="GiftWrapOrder" d:type="enumeration"
d:values="N Y">
<b:FieldInfo/></AttributeType>
<AttributeType name="GiftOrder" d:type="enumeration" d:values="N
Y">
<b:FieldInfo/></AttributeType>
<AttributeType name="CustomerOrderID">
<b:FieldInfo/></AttributeType>
<AttributeType name="AddressOverrideFlag">
<b:FieldInfo/></AttributeType>
<element type="OrderHeader" maxOccurs="1" minOccurs="1"/>
<element type="OrderLines" maxOccurs="1" minOccurs="1"/>
<attribute type="CustomerOrderID" required="yes"/>
<attribute type="GiftOrder" default="N"/>
<attribute type="GiftWrapOrder" default="N"/>
<attribute type="OrderType" required="yes"/>
<attribute type="AddressOverrideFlag"/>
</ElementType><ElementType name="Name" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="FirstName" maxOccurs="1" minOccurs="1"/>
<element type="MiddleName" maxOccurs="1" minOccurs="0"/>
<element type="LastName" maxOccurs="1" minOccurs="1"/>
</ElementType><ElementType name="MiddleName" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="LineSubtotal" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="LineNumber" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="LastName" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="GiftMessage" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="FirstName" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Email" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Description" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="CustomerSKU" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Customer" content="mixed"
model="closed">
<b:RecordInfo/>
<AttributeType name="OrderSource">
<b:FieldInfo/></AttributeType>
<AttributeType name="CustomerID">
<b:FieldInfo/></AttributeType>
<attribute type="CustomerID" required="yes"/>
<attribute type="OrderSource" required="yes"/>
</ElementType><ElementType name="Country" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="ConsumerShippingCharge"
content="textOnly" model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="ConsumerInsurance" content="mixed"
model="closed">
<b:RecordInfo/>
<AttributeType name="ConsumerInsuranceFlag" d:type="enumeration"
d:values="N Y">
<b:FieldInfo/></AttributeType>
<attribute type="ConsumerInsuranceFlag" default="N"/>
</ElementType><ElementType name="ConsumerHandlingFee"
content="textOnly" model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Consumer" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<AttributeType name="Type" d:type="enumeration" d:values="ShipTo
SoldTo">
<b:FieldInfo/></AttributeType>
<AttributeType name="ConsumerID">
<b:FieldInfo/></AttributeType>
<element type="Name" maxOccurs="1" minOccurs="1"/>
<element type="CompanyName" maxOccurs="1" minOccurs="0"/>
<element type="Address" maxOccurs="1" minOccurs="1"/>
<element type="Phone" maxOccurs="1" minOccurs="0"/>
<element type="Email" maxOccurs="1" minOccurs="0"/>
<element type="AgeConfirm" maxOccurs="1" minOccurs="1"/>
<element type="Birthdate" maxOccurs="1" minOccurs="0"/>
<attribute type="Type" required="yes"/>
<attribute type="ConsumerID"/>
</ElementType><ElementType name="CompanyName" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="City" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="CardText" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="CardId" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Card" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="CardId" maxOccurs="1" minOccurs="1"/>
<element type="CardText" maxOccurs="1" minOccurs="1"/>
</ElementType><ElementType name="BottleSize" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="BottleDeposit" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Birthdate" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="App3" content="mixed"
model="closed">
<b:RecordInfo/>
</ElementType><ElementType name="App2" content="mixed"
model="closed">
<b:RecordInfo/>
</ElementType><ElementType name="App1" content="mixed"
model="closed">
<b:RecordInfo/>
</ElementType><ElementType name="AgeConfirm" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="AddressLine2" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="AddressLine1" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Address" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="AddressLine1" maxOccurs="1" minOccurs="1"/>
<element type="AddressLine2" maxOccurs="1" minOccurs="0"/>
<element type="City" maxOccurs="1" minOccurs="1"/>
<element type="State" maxOccurs="1" minOccurs="1"/>
<element type="Zip" maxOccurs="1" minOccurs="1"/>
<element type="Country" maxOccurs="1" minOccurs="0"/>
</ElementType></Schema>
</TrgTree><TreeValues><ConstantValues><Value value="0"
Query="/submitOrderBatch/Orders/Order/OrderHeader/ConsumerHandlingFee"/><Val
ue
value="Yes" Query="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/AgeCo
nfirm"/><Value
value=" " Query="/submitOrderBatch/Orders/Order/OrderHeader/Card/CardText"/>
<Value
value=" " Query="/submitOrderBatch/Orders/Order/OrderHeader/Card/CardId"/><V
alue
value="No" Query="/submitOrderBatch/Orders/Order/OrderHeader/BottleDeposit"/
><Value
value="OrderTypeHere"
Query="/submitOrderBatch/Orders/Order/@OrderType"/></ConstantValues>
</TreeValues><Pages><Page Name="Page 1"><Links><Link LinkID="1"
LinkFrom="/AmazonOrders/Order/@OrderId"
LinkTo="/submitOrderBatch/Orders/Order/@CustomerOrderID"/><Link
LinkID="2" LinkFrom="/AmazonOrders/Order/@PurchaseDate"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/OrderDate"/><Link
LinkID="3" LinkFrom="/AmazonOrders/Order/@ShippingPrice"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/OrderShipping/ConsumerShi
ppingCharge"/><Link
LinkID="4" LinkFrom="/AmazonOrders/Order/@ShipServiceLevel"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/OrderShipping/ShippingPri
ority"/><Link
LinkID="5" LinkFrom="1"
LinkTo="/submitOrderBatch/@CustomerBatchID"/><Link LinkID="6"
LinkFrom="/AmazonOrders/Customer/@CustomerID"
LinkTo="/submitOrderBatch/Customer/@CustomerID"/><Link LinkID="7"
LinkFrom="/AmazonOrders/Customer/@OrderSource"
LinkTo="/submitOrderBatch/Customer/@OrderSource"/><Link LinkID="8"
LinkFrom="/AmazonOrders/Order/Shipping"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer"/><Link
LinkID="9" LinkFrom="/AmazonOrders/Order/OrderItems/OrderItem"
LinkTo="/submitOrderBatch/Orders/Order/OrderLines/OrderLine"/><Link
LinkID="10" LinkFrom="/AmazonOrders/Order/Billing" LinkTo="2"/><Link
LinkID="11" LinkFrom="2"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer"/><Link
LinkID="12" LinkFrom="/AmazonOrders/Order/Shipping" LinkTo="2"/><Link
LinkID="13" LinkFrom="/AmazonOrders/Order/@OrderTax"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/OrderSalesTax"/><Link
LinkID="14" LinkFrom="/AmazonOrders/Order/Billing/Address/@Address1"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/AddressL
ine1"/><Link
LinkID="15" LinkFrom="/AmazonOrders/Order/Billing/Address/@Address2"
LinkTo="3"/><Link LinkID="16"
LinkFrom="/AmazonOrders/Order/Billing/Address/@Address3"
LinkTo="3"/><Link LinkID="17" LinkFrom="3"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/AddressL
ine2"/><Link
LinkID="18" LinkFrom="/AmazonOrders/Order/Billing/Address/@City"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/City"/><
Link
LinkID="19" LinkFrom="/AmazonOrders/Order/Billing/Address/@State"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/State"/>
<Link
LinkID="20" LinkFrom="/AmazonOrders/Order/Billing/Address/@PostalCode"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/Zip"/><L
ink
LinkID="21" LinkFrom="/AmazonOrders/Order/Billing/Address/@Country"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/Country"
/><Link
LinkID="22" LinkFrom="/AmazonOrders/Order/Billing/@Name"
LinkTo="4"/><Link LinkID="23" LinkFrom="4"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Name/FirstName"/
><Link
LinkID="24" LinkFrom="/AmazonOrders/Order/Billing/@Name"
LinkTo="5"/><Link LinkID="25" LinkFrom="5" LinkTo="4"/><Link
LinkID="26" LinkFrom="/AmazonOrders/Order/Billing/@Name"
LinkTo="6"/><Link LinkID="27"
LinkFrom="/AmazonOrders/Order/Billing/@Name" LinkTo="7"/><Link
LinkID="28" LinkFrom="5" LinkTo="7"/><Link LinkID="29" LinkFrom="6"
LinkTo="7"/><Link LinkID="30" LinkFrom="7"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Name/LastName"/>
<Link
LinkID="31" LinkFrom="/AmazonOrders/Order/Billing/@Phone"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Phone"/><Link
LinkID="32" LinkFrom="/AmazonOrders/Order/Billing/@Email"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Email"/><Link
LinkID="33" LinkFrom="/AmazonOrders/Order/Billing"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/@Type"
Compiler-Copy-Directive="CopyName"/><Link LinkID="34"
LinkFrom="/AmazonOrders/Order/Shipping"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/@Type"
Compiler-Copy-Directive="CopyName"/><Link LinkID="35"
LinkFrom="/AmazonOrders/Order/Shipping/Address/@Address1"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/AddressL
ine1"/><Link
LinkID="36" LinkFrom="/AmazonOrders/Order/Shipping/Address/@Address2"
LinkTo="8"/><Link LinkID="37"
LinkFrom="/AmazonOrders/Order/Shipping/Address/@Address3"
LinkTo="8"/><Link LinkID="38" LinkFrom="8"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/AddressL
ine2"/><Link
LinkID="39" LinkFrom="/AmazonOrders/Order/Shipping/Address/@City"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/City"/><
Link
LinkID="40" LinkFrom="/AmazonOrders/Order/Shipping/Address/@State"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/State"/>
<Link
LinkID="41" LinkFrom="/AmazonOrders/Order/Shipping/Address/@PostalCode"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/Zip"/><L
ink
LinkID="42" LinkFrom="/AmazonOrders/Order/Shipping/Address/@Country"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Address/Country"
/><Link
LinkID="43" LinkFrom="/AmazonOrders/Order/Shipping/@Name"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Name/LastName"/>
<Link
LinkID="44" LinkFrom="/AmazonOrders/Order/Shipping/@Phone"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Phone"/><Link
LinkID="45" LinkFrom="/AmazonOrders/Order/Shipping/@Email"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/Consumer/Email"/><Link
LinkID="46" LinkFrom="/AmazonOrders/Order/OrderItems"
LinkTo="/submitOrderBatch/Orders/Order/OrderLines"/><Link LinkID="47"
LinkFrom="/AmazonOrders/Order/OrderItems/OrderItem/@ItemPrice"
LinkTo="/submitOrderBatch/Orders/Order/OrderLines/OrderLine/Product/RetailPr
ice"/><Link
LinkID="48" LinkFrom="/AmazonOrders/Order/OrderItems/OrderItem/@QuantityPurc
hased"
LinkTo="/submitOrderBatch/Orders/Order/OrderLines/OrderLine/Quantity"/><Link
LinkID="49" LinkFrom="/AmazonOrders/Order/OrderItems/OrderItem/@ProductName"
LinkTo="/submitOrderBatch/Orders/Order/OrderLines/OrderLine/Product/Descript
ion"/><Link
LinkID="50" LinkFrom="/AmazonOrders/Order/OrderItems/OrderItem/@Sku"
LinkTo="/submitOrderBatch/Orders/Order/OrderLines/OrderLine/Product/Customer
SKU"/><Link
LinkID="51" LinkFrom="9"
LinkTo="/submitOrderBatch/Orders/Order/OrderLines/OrderLine/LineNumber"/><Li
nk
LinkID="52" LinkFrom="/AmazonOrders/Order/OrderItems/OrderItem"
LinkTo="9"/><Link LinkID="53"
LinkFrom="/AmazonOrders/Order/OrderItems/OrderItem/@ItemPrice"
LinkTo="10"/><Link LinkID="54"
LinkFrom="/AmazonOrders/Order/OrderItems/OrderItem/@QuantityPurchased"
LinkTo="10"/><Link LinkID="55" LinkFrom="10"
LinkTo="/submitOrderBatch/Orders/Order/OrderLines/OrderLine/LineSubtotal"/><
Link
LinkID="56" LinkFrom="/AmazonOrders/Order/@ShippingPrice"
LinkTo="11"/><Link LinkID="57"
LinkFrom="/AmazonOrders/Order/@OrderTax" LinkTo="11"/><Link
LinkID="58" LinkFrom="10" LinkTo="11"/><Link LinkID="59" LinkFrom="11"
LinkTo="/submitOrderBatch/Orders/Order/OrderHeader/OrderTotal"/></Links><Fun
ctoids><Functoid
FunctoidID="1" X-Cell="56" Y-Cell="255" Functoid-FID="125"
Functoid-Version="1"
Script-Functoid="no"><Input-Parameters/></Functoid><Functoid
FunctoidID="2" X-Cell="55" Y-Cell="216" Functoid-FID="424"
Functoid-Version="1" Script-Functoid="no"><Input-Parameters><Parameter
Type="Link" Value="10"/><Parameter Type="Link"
Value="12"/></Input-Parameters></Functoid><Functoid FunctoidID="3"
X-Cell="56" Y-Cell="218" Functoid-FID="107" Functoid-Version="1"
Script-Functoid="no"><Input-Parameters><Parameter Type="Link"
Value="15"/><Parameter Type="Constant" Value=" "/><Parameter
Type="Link" Value="16"/></Input-Parameters></Functoid><Functoid
FunctoidID="4" X-Cell="57" Y-Cell="213" Functoid-FID="106"
Functoid-Version="1" Script-Functoid="no"><Input-Parameters><Parameter
Type="Link" Value="22"/><Parameter Type="Constant"
Value="1"/><Parameter Type="Link"
Value="25"/></Input-Parameters></Functoid><Functoid FunctoidID="5"
X-Cell="54" Y-Cell="210" Functoid-FID="101" Functoid-Version="1"
Script-Functoid="no"><Input-Parameters><Parameter Type="Link"
Value="24"/><Parameter Type="Constant" Value="
"/></Input-Parameters></Functoid><Functoid FunctoidID="6" X-Cell="54"
Y-Cell="209" Functoid-FID="105" Functoid-Version="1"
Script-Functoid="no"><Input-Parameters><Parameter Type="Link"
Value="26"/></Input-Parameters></Functoid><Functoid FunctoidID="7"
X-Cell="57" Y-Cell="214" Functoid-FID="106" Functoid-Version="1"
Script-Functoid="no"><Input-Parameters><Parameter Type="Link"
Value="27"/><Parameter Type="Link" Value="28"/><Parameter Type="Link"
Value="29"/></Input-Parameters></Functoid><Functoid FunctoidID="8"
X-Cell="53" Y-Cell="218" Functoid-FID="107" Functoid-Version="1"
Script-Functoid="no"><Input-Parameters><Parameter Type="Link"
Value="36"/><Parameter Type="Constant" Value=" "/><Parameter
Type="Link" Value="37"/></Input-Parameters></Functoid><Functoid
FunctoidID="9" X-Cell="56" Y-Cell="221" Functoid-FID="474"
Functoid-Version="1" Script-Functoid="no"><Input-Parameters><Parameter
Type="Link" Value="52"/></Input-Parameters></Functoid><Functoid
FunctoidID="10" X-Cell="57" Y-Cell="222" Functoid-FID="120"
Functoid-Version="1" Script-Functoid="no"><Input-Parameters><Parameter
Type="Link" Value="53"/><Parameter Type="Link"
Value="54"/></Input-Parameters></Functoid><Functoid FunctoidID="11"
X-Cell="60" Y-Cell="224" Functoid-FID="118" Functoid-Version="1"
Script-Functoid="no"><Input-Parameters><Parameter Type="Link"
Value="56"/><Parameter Type="Link" Value="57"/><Parameter Type="Link"
Value="58"/></Input-Parameters></Functoid></Functoids></Page></Pages><Compil
edXSL><xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="urn:var"
xmlns:userVBScript="urn:userVBScript"
xmlns:userJScript="urn:userJScript" exclude-result-prefixes="msxsl var
userVBScript userJScript" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="AmazonOrders"/>
</xsl:template>
<xsl:template match="AmazonOrders">
<submitOrderBatch>
<xsl:variable name="var:v1"
select="uservbscript :fctdatecurrentdatetime()"/>
<xsl:attribute name="CustomerBatchID"><xsl:value-of
select="$var:v1"/></xsl:attribute>
<xsl:for-each select="Customer">
<Customer>
<xsl:if test="@CustomerID"><xsl:attribute
name="CustomerID"><xsl:value-of
select="@CustomerID"/></xsl:attribute></xsl:if>
<xsl:if test="@OrderSource"><xsl:attribute
name="OrderSource"><xsl:value-of
select="@OrderSource"/></xsl:attribute></xsl:if>
</Customer>
</xsl:for-each>
<Orders>
<xsl:for-each select="Order">
<Order>
<xsl:if test="@OrderId"><xsl:attribute
name="CustomerOrderID"><xsl:value-of
select="@OrderId"/></xsl:attribute></xsl:if>
<xsl:attribute name="OrderType">OrderTypeHere</xsl:attribute>
<OrderHeader>
<xsl:if test="@PurchaseDate"><OrderDate><xsl:value-of
select="@PurchaseDate"/></OrderDate></xsl:if>
<xsl:for-each select="Billing">
<Consumer>
<xsl:if test="."><xsl:attribute
name="Type">Billing</xsl:attribute></xsl:if>
<Name>
<xsl:variable name="var:v2"
select=" uservbscript :fctstringfind(string(@Name)
," ")"/>
<xsl:variable name="var:v3"
select=" uservbscript :fctstringsubstr(string(@Nam
e),"1",string($var
:v2))"/>
<FirstName><xsl:value-of select="$var:v3"/></FirstName>
<xsl:variable name="var:v4"
select=" uservbscript :fctstringsize(string(@Name)
)"/>
<xsl:variable name="var:v5"
select=" uservbscript :fctstringsubstr(string(@Nam
e),string($var:v2),string($v
ar:v4))"/>
<LastName><xsl:value-of select="$var:v5"/></LastName>
</Name>
<Address>
<xsl:if test="Address/@Address1"><AddressLine1><xsl:value-of
select="Address/@Address1"/></AddressLine1></xsl:if>
<xsl:variable name="var:v6"
select=" uservbscript :fctstringconcat3(string(Add
ress/@Address2),"
",string(Address/@Address3))"/>
<AddressLine2><xsl:value-of
select="$var:v6"/></AddressLine2>
<xsl:if test="Address/@City"><City><xsl:value-of
select="Address/@City"/></City></xsl:if>
<xsl:if test="Address/@State"><State><xsl:value-of
select="Address/@State"/></State></xsl:if>
<xsl:if test="Address/@PostalCode"><Zip><xsl:value-of
select="Address/@PostalCode"/></Zip></xsl:if>
<xsl:if test="Address/@Country"><Country><xsl:value-of
select="Address/@Country"/></Country></xsl:if>
</Address>
<xsl:if test="@Phone"><Phone><xsl:value-of
select="@Phone"/></Phone></xsl:if>
<xsl:if test="@Email"><Email><xsl:value-of
select="@Email"/></Email></xsl:if>
<AgeConfirm>Yes</AgeConfirm>
</Consumer>
</xsl:for-each>
<xsl:for-each select="Shipping">
<Consumer>
<xsl:if test="."><xsl:attribute
name="Type">Shipping</xsl:attribute></xsl:if>
<Name>
<xsl:if test="@Name"><LastName><xsl:value-of
select="@Name"/></LastName></xsl:if>
</Name>
<Address>
<xsl:if test="Address/@Address1"><AddressLine1><xsl:value-of
select="Address/@Address1"/></AddressLine1></xsl:if>
<xsl:variable name="var:v7"
select=" uservbscript :fctstringconcat3(string(Add
ress/@Address2),"
",string(Address/@Address3))"/>
<AddressLine2><xsl:value-of
select="$var:v7"/></AddressLine2>
<xsl:if test="Address/@City"><City><xsl:value-of
select="Address/@City"/></City></xsl:if>
<xsl:if test="Address/@State"><State><xsl:value-of
select="Address/@State"/></State></xsl:if>
<xsl:if test="Address/@PostalCode"><Zip><xsl:value-of
select="Address/@PostalCode"/></Zip></xsl:if>
<xsl:if test="Address/@Country"><Country><xsl:value-of
select="Address/@Country"/></Country></xsl:if>
</Address>
<xsl:if test="@Phone"><Phone><xsl:value-of
select="@Phone"/></Phone></xsl:if>
<xsl:if test="@Email"><Email><xsl:value-of
select="@Email"/></Email></xsl:if>
<AgeConfirm>Yes</AgeConfirm>
<xsl:if test="."><xsl:value-of select="./text()"/></xsl:if>
</Consumer>
</xsl:for-each>
<ConsumerHandlingFee>0</ConsumerHandlingFee>
<OrderShipping>
<xsl:if test="@ShippingPrice"><ConsumerShippingCharge><xsl:value-of
select="@ShippingPrice"/></ConsumerShippingCharge></xsl:if>
<xsl:if test="@ShipServiceLevel"><ShippingPriority><xsl:value-of
select="@ShipServiceLevel"/></ShippingPriority></xsl:if>
</OrderShipping>
<xsl:if test="@OrderTax"><OrderSalesTax><xsl:value-of
select="@OrderTax"/></OrderSalesTax></xsl:if>
<BottleDeposit>No</BottleDeposit>
<xsl:variable name="var:v8"
select=" uservbscript :fctmathmultiply2(string(Ord
erItems/OrderItem/@ItemPrice
),string(OrderItems/OrderItem/@QuantityPurchased))"/>
<xsl:variable name="var:v9"
select=" uservbscript :fctmathadd3(string(@Shippin
gPrice),string(@OrderTax),st
ring($var:v8))"/>
<OrderTotal><xsl:value-of select="$var:v9"/></OrderTotal>
<Card>
<CardId>
</CardId>
<CardText>
</CardText>
</Card>
</OrderHeader>
<xsl:for-each select="OrderItems">
<OrderLines>
<xsl:for-each select="OrderItem">
<xsl:variable name="var:v10" select="position()"/>
<OrderLine>
<LineNumber><xsl:value-of select="$var:v10"/></LineNumber>
<xsl:if test="@QuantityPurchased"><Quantity><xsl:value-of
select="@QuantityPurchased"/></Quantity></xsl:if>
<Product>
<xsl:if test="@Sku"><CustomerSKU><xsl:value-of
select="@Sku"/></CustomerSKU></xsl:if>
<xsl:if test="@ItemPrice"><RetailPrice><xsl:value-of
select="@ItemPrice"/></RetailPrice></xsl:if>
<xsl:if test="@ProductName"><Description><xsl:value-of
select="@ProductName"/></Description></xsl:if>
</Product>
<xsl:variable name="var:v11"
select=" uservbscript :fctmathmultiply2(string(@It
emPrice),string(@QuantityPur
chased))"/>
<LineSubtotal><xsl:value-of
select="$var:v11"/></LineSubtotal>
<xsl:if test="."><xsl:value-of
select="./text()"/></xsl:if>
</OrderLine>
</xsl:for-each>
<xsl:if test="."><xsl:value-of select="./text()"/></xsl:if>
</OrderLines>
</xsl:for-each>
</Order>
</xsl:for-each>
</Orders>
</submitOrderBatch>
</xsl:template>
<msxsl:script language="VBScript" implements-prefix="userVBScript">
<![CDATA[
Function FctDateCurrentDateTime()
Dim dt
Dim y
Dim m
Dim d
Dim h
Dim s
dt = Now()
y = CStr(Year(dt))
m = CStr(Month(dt))
d = CStr(Day(dt))
If Len(m) = 1 Then
m = "0" & m
End If
If Len(d) = 1 Then
d = "0" & d
End If
'ISO 8601 format
FctDateCurrentDateTime = CStr(Year(dt)) & "-" & m & "-" & d
h = CStr(Hour(dt))
If Len(h) = 1 Then
h = "0" & h
End If
m = CStr(Minute(dt))
If Len(m) = 1 Then
m = "0" & m
End If
s = CStr(Second(dt))
If Len(s) = 1 Then
s = "0" & s
End If
'ISO 8601 format
FctDateCurrentDateTime = FctDateCurrentDateTime & "T" & h & ":" &
m & ":" & s
End Function
Function FctStringConcat3( p_strParm0, p_strParm1, p_strParm2 )
FctStringConcat3 = p_strParm0 + p_strParm1 + p_strParm2
End Function
Function FctStringSubstr( p_strA, p_cchLeft, p_cchRight )
If ( IsNumeric( p_cchLeft ) And IsNumeric( p_cchRight ) ) Then
p_cchLeft = CLng(p_cchLeft)
p_cchRight = CLng(p_cchRight)
If ( p_cchLeft > 0 And ( p_cchRight >= p_cchLeft ) ) Then
FctStringSubstr = mid( p_strA, p_cchLeft, p_cchRight -
p_cchLeft + 1 )
Else
FctStringSubstr = ""
End If
Else
FctStringSubstr = ""
End If
End Function
Function FctStringFind( p_strA, p_strFind )
FctStringFind = CStr( InStr( p_strA, p_strFind ) )
End Function
Function FctStringSize( p_strA )
FctStringSize = CStr( len( p_strA ) )
End Function
Function FctMathMultiply2( p_strParm0, p_strParm1 )
If ( IsNumeric( p_strParm0 ) And IsNumeric( p_strParm1 ) ) Then
FctMathMultiply2 = CDbl( p_strParm0 ) * CDbl( p_strParm1 )
Else
FctMathMultiply2 = ""
End If
End Function
Function FctMathAdd3( p_strParm0, p_strParm1, p_strParm2 )
If ( IsNumeric( p_strParm0 ) And IsNumeric( p_strParm1 ) And
IsNumeric( p_strParm2 ) ) Then
FctMathAdd3 = CDbl( p_strParm0 ) + CDbl( p_strParm1 ) + CDbl(
p_strParm2 )
Else
FctMathAdd3 = ""
End If
End Function
]]>
</msxsl:script>
<msxsl:script language="JScript" implements-prefix="userJScript">
<![CDATA[
]]>
</msxsl:script>
</xsl:stylesheet>
</CompiledXSL></mapsource>
Here's the middle schema:
<?xml version="1.0"?>
<!-- Generated by using BizTalk Editor on Mon, Jan 12 2004 05:08:13 PM
-->
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<Schema name="AmazonOrders" b:BizTalkServerEditorTool_Version="1.5"
b:root_reference="AmazonOrders" b:standard="XML"
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:d="urn:schemas-microsoft-com:datatypes">
<b:SelectionFields/>
<ElementType name="Shipping" content="eltOnly" model="closed">
<b:RecordInfo/>
<AttributeType name="Phone">
<b:FieldInfo/></AttributeType>
<AttributeType name="Name">
<b:FieldInfo/></AttributeType>
<AttributeType name="Email">
<b:FieldInfo/></AttributeType>
<element type="Address" maxOccurs="1" minOccurs="0"/>
<attribute type="Name" required="no"/>
<attribute type="Phone" required="no"/>
<attribute type="Email" required="no"/>
</ElementType><ElementType name="OrderItems" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="OrderItem" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="OrderItem" content="empty"
model="closed">
<b:RecordInfo/>
<AttributeType name="Sku" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="QuantityPurchased" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ProductName" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="ItemPrice" d:type="r4">
<b:FieldInfo/></AttributeType>
<attribute type="ItemPrice" required="no"/>
<attribute type="QuantityPurchased" required="no"/>
<attribute type="ProductName" required="no"/>
<attribute type="Sku" required="no"/>
</ElementType><ElementType name="Order" content="eltOnly"
model="closed">
<b:RecordInfo/>
<AttributeType name="ShippingPrice" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="ShipServiceLevel">
<b:FieldInfo/></AttributeType>
<AttributeType name="PurchaseDate" d:type="string">
<b:FieldInfo/></AttributeType>
<AttributeType name="OrderTax" d:type="r4">
<b:FieldInfo/></AttributeType>
<AttributeType name="OrderId" d:type="string">
<b:FieldInfo/></AttributeType>
<attribute type="OrderId" required="no"/>
<attribute type="PurchaseDate" required="no"/>
<attribute type="ShippingPrice" required="no"/>
<attribute type="OrderTax" required="no"/>
<attribute type="ShipServiceLevel" required="no"/>
<element type="Billing" maxOccurs="1" minOccurs="0"/>
<element type="Shipping" maxOccurs="1" minOccurs="0"/>
<element type="OrderItems" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="Customer" content="empty"
model="closed">
<b:RecordInfo/>
<AttributeType name="OrderSource">
<b:FieldInfo/></AttributeType>
<AttributeType name="CustomerID">
<b:FieldInfo/></AttributeType>
<attribute type="CustomerID" required="no"/>
<attribute type="OrderSource" required="no"/>
</ElementType><ElementType name="Billing" content="eltOnly"
model="closed">
<b:RecordInfo/>
<AttributeType name="Phone">
<b:FieldInfo/></AttributeType>
<AttributeType name="Name">
<b:FieldInfo/></AttributeType>
<AttributeType name="Email">
<b:FieldInfo/></AttributeType>
<element type="Address" maxOccurs="1" minOccurs="0"/>
<attribute type="Name" required="no"/>
<attribute type="Phone" required="no"/>
<attribute type="Email" required="no"/>
</ElementType><ElementType name="AmazonOrders" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="Order" maxOccurs="*" minOccurs="1"/>
<element type="Customer" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="Address" content="empty"
model="closed">
<b:RecordInfo/>
<AttributeType name="State">
<b:FieldInfo/></AttributeType>
<AttributeType name="PostalCode">
<b:FieldInfo/></AttributeType>
<AttributeType name="Country">
<b:FieldInfo/></AttributeType>
<AttributeType name="City">
<b:FieldInfo/></AttributeType>
<AttributeType name="Address3">
<b:FieldInfo/></AttributeType>
<AttributeType name="Address2">
<b:FieldInfo/></AttributeType>
<AttributeType name="Address1">
<b:FieldInfo/></AttributeType>
<attribute type="Address1" required="no"/>
<attribute type="Address2" required="no"/>
<attribute type="Address3" required="no"/>
<attribute type="City" required="no"/>
<attribute type="State" required="no"/>
<attribute type="PostalCode" required="no"/>
<attribute type="Country" required="no"/>
</ElementType></Schema>
And the final schema:
<?xml version="1.0"?>
<!-- Generated by using BizTalk Editor on Mon, Jan 12 2004 11:20:29 AM
-->
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<Schema name="submitOrderBatch"
b:BizTalkServerEditorTool_Version="1.5"
b:root_reference="submitOrderBatch" b:standard="XML"
xmlns="urn:schemas-microsoft-com:xml-data"
xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:d="urn:schemas-microsoft-com:datatypes">
<b:SelectionFields/>
<ElementType name="submitOrderBatch" content="eltOnly" order="seq"
model="closed">
<b:RecordInfo/>
<AttributeType name="CustomerBatchID">
<b:FieldInfo/></AttributeType>
<element type="Customer" maxOccurs="1" minOccurs="1"/>
<element type="Orders" maxOccurs="1" minOccurs="1"/>
<element type="CustomerSKU" maxOccurs="1" minOccurs="1"/>
<element type="RetailPrice" maxOccurs="1" minOccurs="1"/>
<element type="Description" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="Phone" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Orders" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="Order" maxOccurs="*" minOccurs="1"/>
</ElementType><ElementType name="OrderTotal" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="OrderShipping" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="ConsumerShippingCharge" maxOccurs="1" minOccurs="1"/>
<element type="ShippingPriority" maxOccurs="1" minOccurs="0"/>
<element type="ShippingInstructions" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="OrderSalesTax" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="OrderLines" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="OrderLine" maxOccurs="*" minOccurs="1"/>
</ElementType><ElementType name="OrderLine" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="LineNumber" maxOccurs="1" minOccurs="1"/>
<element type="Quantity" maxOccurs="1" minOccurs="1"/>
<element type="Product" maxOccurs="1" minOccurs="1"/>
<element type="LineSubtotal" maxOccurs="1" minOccurs="1"/>
</ElementType><ElementType name="OrderHeaderMisc" content="eltOnly"
model="closed">
<b:RecordInfo/>
<element type="GiftMessage" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="OrderHeader" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="OrderDate" maxOccurs="1" minOccurs="0"/>
<element type="Consumer" maxOccurs="*" minOccurs="1"/>
<element type="ConsumerHandlingFee" maxOccurs="1" minOccurs="1"/>
<element type="OrderShipping" maxOccurs="1" minOccurs="1"/>
<element type="OrderSalesTax" maxOccurs="1" minOccurs="1"/>
<element type="OrderTotal" maxOccurs="1" minOccurs="1"/>
<element type="OrderHeaderMisc" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="OrderDate" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Order" content="eltOnly" order="seq"
model="closed">
<b:RecordInfo/>
<AttributeType name="OrderType">
<b:FieldInfo/></AttributeType>
<AttributeType name="GiftWrapOrder" d:type="enumeration" d:values="N
Y">
<b:FieldInfo/></AttributeType>
<AttributeType name="GiftOrder" d:type="enumeration" d:values="N Y">
<b:FieldInfo/></AttributeType>
<AttributeType name="CustomerOrderID">
<b:FieldInfo/></AttributeType>
<AttributeType name="AddressOverrideFlag">
<b:FieldInfo/></AttributeType>
<element type="OrderHeader" maxOccurs="1" minOccurs="1"/>
<element type="OrderLines" maxOccurs="1" minOccurs="1"/>
<attribute type="CustomerOrderID" required="yes"/>
<attribute type="GiftOrder" default="N"/>
<attribute type="GiftWrapOrder" default="N"/>
<attribute type="OrderType" required="yes"/>
<attribute type="AddressOverrideFlag"/>
</ElementType><ElementType name="Name" content="eltOnly" order="seq"
model="closed">
<b:RecordInfo/>
<element type="FirstName" maxOccurs="1" minOccurs="1"/>
<element type="MiddleName" maxOccurs="1" minOccurs="0"/>
<element type="LastName" maxOccurs="1" minOccurs="1"/>
</ElementType><ElementType name="MiddleName" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="LineSubtotal" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="LineNumber" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="LastName" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="GiftMessage" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="FirstName" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Email" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Description" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="CustomerSKU" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Customer" content="mixed"
model="closed">
<b:RecordInfo/>
<AttributeType name="OrderSource">
<b:FieldInfo/></AttributeType>
<AttributeType name="CustomerID">
<b:FieldInfo/></AttributeType>
<attribute type="CustomerID" required="yes"/>
<attribute type="OrderSource" required="yes"/>
</ElementType><ElementType name="Country" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="ConsumerShippingCharge"
content="textOnly" model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="ConsumerInsurance" content="mixed"
model="closed">
<b:RecordInfo/>
<AttributeType name="ConsumerInsuranceFlag" d:type="enumeration"
d:values="N Y">
<b:FieldInfo/></AttributeType>
<attribute type="ConsumerInsuranceFlag" default="N"/>
</ElementType><ElementType name="ConsumerHandlingFee"
content="textOnly" model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Consumer" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<AttributeType name="Type" d:type="enumeration" d:values="ShipTo
SoldTo">
<b:FieldInfo/></AttributeType>
<AttributeType name="ConsumerID">
<b:FieldInfo/></AttributeType>
<element type="Name" maxOccurs="1" minOccurs="1"/>
<element type="CompanyName" maxOccurs="1" minOccurs="0"/>
<element type="Address" maxOccurs="1" minOccurs="1"/>
<element type="Phone" maxOccurs="1" minOccurs="0"/>
<element type="Email" maxOccurs="1" minOccurs="0"/>
<element type="AgeConfirm" maxOccurs="1" minOccurs="1"/>
<element type="Birthdate" maxOccurs="1" minOccurs="0"/>
<attribute type="Type" required="yes"/>
<attribute type="ConsumerID"/>
</ElementType><ElementType name="CompanyName" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="City" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="CardText" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="CardId" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Card" content="eltOnly" order="seq"
model="closed">
<b:RecordInfo/>
<element type="CardId" maxOccurs="1" minOccurs="1"/>
<element type="CardText" maxOccurs="1" minOccurs="1"/>
</ElementType><ElementType name="BottleSize" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="AddressLine2" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="AddressLine1" content="textOnly"
model="closed">
<b:FieldInfo/>
</ElementType><ElementType name="Address" content="eltOnly"
order="seq" model="closed">
<b:RecordInfo/>
<element type="AddressLine1" maxOccurs="1" minOccurs="1"/>
<element type="AddressLine2" maxOccurs="1" minOccurs="0"/>
<element type="City" maxOccurs="1" minOccurs="1"/>
<element type="State" maxOccurs="1" minOccurs="1"/>
<element type="Zip" maxOccurs="1" minOccurs="1"/>
<element type="Country" maxOccurs="1" minOccurs="0"/>
</ElementType></Schema>
Jan Eliasen <spam@eliasen.dk> wrote in message news:<7fr700pa6ndgonfd0017nu718gdvl74ata@
4ax.com>...
> On 12 Jan 2004 19:28:56 -0800, jlukensmeyer@yahoo.com (Jeremy
> Lukensmeyer) wrote:
>
> Could you post your documentspecifications and a test-input.example?
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Mapping flat file of orders (one line for each order) to order XML with multiple i |
 |
 |
|
|
02-08-04 01:43 PM
Jan,
Were you able to read my post with specs and samples last
night? I posted it through Google, but I can't see it on
the MS web site. If it didn't come through could I email
you the specs?
Thanks,
Jeremy
>-----Original Message-----
>On 12 Jan 2004 19:28:56 -0800, jlukensmeyer@yahoo.com
(Jeremy
>Lukensmeyer) wrote:
>
>Could you post your documentspecifications and a test-
input.example?
>
file of orders
delimited file
need help with is
and I want
my XML.
shipping
Consumer records in
a field in
mappings.
billing and
looping functiod
Consumer record.
records of
taking, and
can do this in
>
>--
>Jan Eliasen, representing himself and not the company he
works for.
> MCP in Microsoft BizTalk Server
>.
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Mapping flat file of orders (one line for each order) to order XML with multiple i |
 |
 |
|
|
02-08-04 01:43 PM
On Wed, 14 Jan 2004 10:57:18 -0800, "Jeremy Lukensmeyer"
<anonymous@discussions.microsoft.com> wrote:
Yes, I can see them - I just haven't had time to look at them.
>Jan,
>
>Were you able to read my post with specs and samples last
>night? I posted it through Google, but I can't see it on
>the MS web site. If it didn't come through could I email
>you the specs?
>
>Thanks,
>Jeremy
>(Jeremy
>input.example?
>file of orders
>delimited file
>need help with is
>and I want
>my XML.
>shipping
>Consumer records in
>a field in
>mappings.
>billing and
>looping functiod
>Consumer record.
>records of
>taking, and
>can do this in
>works for.
--
Jan Eliasen, representing himself and not the company he works for.
MCP in Microsoft BizTalk Server
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Mapping flat file of orders (one line for each order) to order XML with multiple i |
 |
 |
|
|
02-08-04 01:43 PM
On 13 Jan 2004 22:54:42 -0800, jlukensmeyer@yahoo.com (Jeremy
Lukensmeyer) wrote:
I have taken a brief look at it, and I can't even validate the
example-input you have given against the input-schema. Maybe some
characters were messed up in the posting. Please try attaching the
docspecs, maps and example-file to an email to me.
>Below are an example, the doc specs, and my current transformations.
>(I trimmed some of the final spec out because I can't release it
>completely.)
>
>Thanks again,
>Jeremy
>
>Here's the sample input - tab delimited - EOL for end of line
>
>order-id order-item-id purchase-date payments-date buyer-email buyer-name buyer-pho
ne-number sku product-name quantity-purchased item-price item-tax shipping-price shi
pping-tax ship-service-level recepient-name ship-address-1 ship-address-2 ship-addre
ss-
3 ship-city ship-state ship-postal-code ship-countryEOL
>058-3529793-7149164 23859249200062 2003-12-11T12:43:20-08:00 2003-12-11T15:06:10-08:00 [em
ail]test@test.com[/email] Tester
>Testing 123-123-1234 A203 Os Asian Fusion
>Vinaigrette 1 30 0 5.5 0 Standard Sam Jones 1 Fourth Street San
>Rafael CA 94901 USEOL
>058-3529793-7149164 58748177283414 2003-12-11T12:43:20-08:00 2003-12-11T15:06:10-08:00 [em
ail]test@test.com[/email] Tester
>Testing 123-123-1234 A205 Os Thai Fusion
>Vinaigrette 1 30 0 5.5 0 Standard Sam Jones 1 Fourth Street San
>Rafael CA 94901 USEOL
>058-9975897-6507554 55890343065094 2003-12-11T12:43:20-08:00 2003-12-11T15:06:25-08:00 [em
ail]test@test.com[/email] Tester
>Testing 123-123-1234 A204 Os World Fusion
>Vinaigrette 1 30 0 8 0 Standard Tester Test 1 Alpine St. San
>Rafael CA 94901 USEOL
--
Jan Eliasen, representing himself and not the company he works for.
MCP in Microsoft BizTalk Server
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
RE: Mapping flat file of orders (one line for each order) to order XML with multiple i |
 |
 |
|
|
| |
|