Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a Purchase Order in XML
Message
General information
Forum:
Visual FoxPro
Category:
Web Services
Miscellaneous
Thread ID:
00798079
Message ID:
00798205
Views:
29
XMLTOCURSOR and CURSORTOXML will all all flexibility to convert
XML to Cursor or Cursor to XML.

Though with the mentioned example the data of both the file will come in one cursor.
You need to apply normalization to divide in two tables or two cursors.

Aashish

>I need to add XML functionality to my application. I want to start by creating a purchase order via xml so my customers can send the PO elecronically to the vendor. I have a vendor that is willing to work with me as I develop this feature.
>
>The vendor sent me a sample xml document they receive from a client:
>
>
><?xml version="1.0" encoding="utf-8"?>
><PurchaseOrder>
>	<OrderHeader>
>		<POIssuedDate>20030318T193435</POIssuedDate>
>		<RequestedDeliveryDate>20030318T193435</RequestedDeliveryDate>
>		<OrderReference>
>			<AccountCode>
>				<Reference>
>					<RefNum>1212909801</RefNum> (our trading partner’s ID)
>				</Reference>
>			</AccountCode>
>			<BuyerRefNum>
>				<Reference>
>					<RefNum>Z78740</RefNum> (PO#)
>				</Reference>
>			</BuyerRefNum>
>		</OrderReference>
>		<OrderParty>
>			<SupplierParty>
>				<Party PartyID="18-710-1399"/> (our trade ID)
>				<NameAddress>
>					<Name1>Kaman Music Corporation</Name1>
>				</NameAddress>
>			</SupplierParty>
>			<ShipToParty>
>				<Party PartyID="2"/> (ID assigned to this location)
>				<NameAddress>
>                                <Identifier>
>                                <Ident>DROP SHIP</Ident>
>                                </Identifier>
>                                <Attention>Mike Smith</Attention>
>					<Name1>Mike’s Music</Name1>
>					<Address1>2114 Tech Drive</Address1>
>					<Address2/>
>					<City>South Bend</City>
>					<StateOrProvince>IN</StateOrProvince>
>					<PostalCode>46628</PostalCode>
>					<Country>United States</Country>
>				</NameAddress>
>			</ShipToParty>
>		</OrderParty>
>		<Payment>
>			<PaymentTerm>Other</PaymentTerm>
>			<PaymentTermOther>21</PaymentTermOther> (previously agreed upon terms – will discuss later)
>		</Payment>
>		<SpecialHandlingNote>4% FREIGHT ALLOWANCE  </SpecialHandlingNote>
>		<Transport>
>			<Carrier>Other</Carrier>
>			<CarrierOther>1</CarrierOther> (carrier code. Ex: 1 = UPS)
>		</Transport>
>	</OrderHeader>
>	<ListOfOrderDetail>
>		<OrderDetail>
>			<BaseItemDetail>
>				<LineItemNum>1</LineItemNum>
>				<BuyerPartNum>
>					<PartNum>
>						<PartID>17740</PartID> (your item id)
>					</PartNum>
>				</BuyerPartNum>
>				<ManufacturerPartNum>
>					<PartNum>
>						<Agency AgencyID="Other">UPC</Agency>
>						<PartID>00731201528238</PartID> (Item UPC code)
>					</PartNum>
>				</ManufacturerPartNum>
>				<BackOrderItem>Y</BackOrderItem>
>				<ItemDescription>LP LP637</ItemDescription>
>				<Quantity>
>					<Qty>3</Qty>
>				</Quantity>
>			</BaseItemDetail>
>			<BuyerExpectedUnitPrice>
>				<Price>
>					<UnitPrice Currency="USD">123.45</UnitPrice>
>				</Price>
>			</BuyerExpectedUnitPrice>
>		</OrderDetail>
>		<OrderDetail>
>			<BaseItemDetail>
>				<LineItemNum>2</LineItemNum>
>				<BuyerPartNum>
>					<PartNum>
>						<PartID>56600</PartID>
>					</PartNum>
>				</BuyerPartNum>
>				<ManufacturerPartNum>
>					<PartNum>
>						<Agency AgencyID="Other">UPC</Agency>
>						<PartID>00622537350054</PartID>
>					</PartNum>
>				</ManufacturerPartNum>
>				<BackOrderItem>Y</BackOrderItem>
>				<ItemDescription>Sabian 35005</ItemDescription>
>				<Quantity>
>					<Qty>1</Qty>
>				</Quantity>
>			</BaseItemDetail>
>			<BuyerExpectedUnitPrice>
>				<Price>
>					<UnitPrice Currency="USD">123.45</UnitPrice>
>				</Price>
>			</BuyerExpectedUnitPrice>
>		</OrderDetail>
>	</ListOfOrderDetail>
></PurchaseOrder>
>
>
>It seems to me their are 2 major components: OrderHeader and ListOfOrderDetail.
>
>With my purchase order program the info that would go into orderheader is on the form in text boxes (Po#, Date, Address info, etc) and the info that would go into listorderdetail would be in a cursor (the line items to be ordered).
>
>The Vendor also sent me a list of the minimum requirements...but I won't display them here unless it would help.
>
>Will I be able to produce a document like this with CursorToXml()?
>
>It seems to me I would need to put all of the info in the cursor. However if I include the vendor#, date, etc in the cursor then it will be repeated for every lineitem?
>
>Can you point me in the right direction?
>
>Thank you in advance
>
>Paul Acton
--
--
Aashish Sharma
Tele Nos: +1-201-490-5405
Mobile: +91-9821053938
E-Mail:
aashish@aashishsharma.com
write2aashish@gmail.com

You better believe in yourself... if you don't, who else will ?
TODAY is a gift, that's why it's called PRESENT
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform