Message
 
To
08/05/2017 12:28:02
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008 R2
Network:
Windows Server 2008 R2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01650938
Message ID:
01650956
Views:
77
>>Hi all,
>>
>>I'm trying to read in an xml file that is a transaction so have a header and detail lines in the one xml file. The xmltocursor command reads in the header details fine but the stock lines are dumped into a memo that I cannot parse. I've played with the parameters to no avail. Is there is way to separate out the stock lines from the file?
>>
>>~M
>
>Yes. Can you post the XML document schema here? Or, on its absence, an example?
The file is below, the utf as 16 is incorrect and should be 8.
<?xml version="1.0" encoding="utf-16"?>
<Orders>
	<Order xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
		<DeliveryCompanyName />
		<DeliveryTitle>Mr</DeliveryTitle>
		<DeliveryFirstName>First</DeliveryFirstName>
		<DeliveryLastName>Name</DeliveryLastName>
		<DeliveryAddress1>64 Zoo Lane</DeliveryAddress1>
		<DeliveryAddress2></DeliveryAddress2>
		<DeliveryAddress3 />
		<DeliveryTown></DeliveryTown>
		<DeliveryCounty />
		<DeliveryCountry>244</DeliveryCountry>
		<DeliveryPhone>1234567</DeliveryPhone>
		<BillingTitle>Mr</BillingTitle>
		<BillingFirstName>First</BillingFirstName>
		<BillingLastName>Name</BillingLastName>
		<BillingCompanyName>Technology Company</BillingCompanyName>
		<BillingAddress1>64 Zoo Lane</BillingAddress1>
		<BillingAddress2 />
		<BillingAddress3 />
		<BillingTown></BillingTown>
		<BillingCounty></BillingCounty>
		<BillingPostcode>postcode</BillingPostcode>
		<BillingCountry>244</BillingCountry>
		<BillingPhone>1234567</BillingPhone>
		<CompanyCode />
		<Currency>3</Currency>
		<DomainID>2</DomainID>
		<OrderID>1033</OrderID>
		<OrderDate>2017-02-23T13:59:57.343</OrderDate>
		<Login>login@company.com</Login>
		<TotalGross>405.90</TotalGross>
		<TotalNet>330.00</TotalNet>
		<TotalTax>75.90</TotalTax>
		<OrderLines>
			<OrderLine ItemTypeName="OrderDiscount">
				<OrderLineID>87</OrderLineID>
				<Code>MHA - Fixed Amount off an Order</Code>
				<Name>MHA - Fixed Amount off an Order</Name>
				<Quantity>1</Quantity>
				<UnitPrice>0.000000</UnitPrice>
				<UnitPriceDiscounted>-20.000000</UnitPriceDiscounted>
				<UnitDiscount>20.000000</UnitDiscount>
				<LinePrice>0.00</LinePrice>
				<LinePriceDiscounted>-20.00</LinePriceDiscounted>
				<TotalTax>-4.60</TotalTax>
				<TotalNet>-20.00</TotalNet>
				<TotalGross>-24.60</TotalGross>
			</OrderLine>
			<OrderLine ItemTypeName="DeliveryOption">
				<OrderLineID>89</OrderLineID>
				<Code>ZeusFleet</Code>
				<Name>Delivery Via Fleet</Name>
				<Quantity>1</Quantity>
				<UnitPrice>0.000000</UnitPrice>
				<UnitPriceDiscounted>0.000000</UnitPriceDiscounted>
				<UnitDiscount>0.000000</UnitDiscount>
				<LinePrice>0.00</LinePrice>
				<LinePriceDiscounted>0.00</LinePriceDiscounted>
				<TotalTax>0.00</TotalTax>
				<TotalNet>0.00</TotalNet>
				<TotalGross>0.00</TotalGross>
			</OrderLine>
			<OrderLine ItemTypeName="Product">
				<OrderLineID>88</OrderLineID>
				<Code>BB=CURVE9320-WH</Code>
				<Name>BlackBerry Curve 9320 White</Name>
				<Quantity>1</Quantity>
				<UnitPrice>350.000000</UnitPrice>
				<UnitPriceDiscounted>350.000000</UnitPriceDiscounted>
				<UnitDiscount>0.000000</UnitDiscount>
				<LinePrice>350.00</LinePrice>
				<LinePriceDiscounted>350.00</LinePriceDiscounted>
				<TotalTax>80.50</TotalTax>
				<TotalNet>350.00</TotalNet>
				<TotalGross>430.50</TotalGross>
			</OrderLine>
		</OrderLines>
		<OrderDiscounts>
			<OrderDiscount>
				<Code>MHA - Fixed Amount off an Order</Code>
				<Name>MHA - Fixed Amount off an Order</Name>
				<TotalTax>0.0000</TotalTax>
				<TotalNet>20.0000</TotalNet>
				<TotalGross>20.0000</TotalGross>
				<UnitDiscount />
				<UnitPriceDiscounted />
				<LineDiscount />
				<LinePriceDiscounted />
			</OrderDiscount>
		</OrderDiscounts>
	</Order>
</Orders>
~M
Go raibh maith agat

~M
Previous
Next
Reply
Map
View