I have an XML document formatted like so:
Im trying to get the Line1 of each Badge and also the sum of PinQuantity and MagQuantity. Then wright Line1 with a streamwriter. I want to take the sum and wright Line1 that number of times. I've been trying to look for the best way to do this and the only ways I found I feel are wrong. Im using VB.net and .net version 2
Heres the code that Ive come up with,
I havent done anything with XML and Vb.net.
THANKS A TON
Code:
<?xml version="1.0"?>
<BadgeOrders>
<Order Ordernum="HOL090122114802" OrderDate="1/22/2009 11:48:02 AM">
<Contact>
<PersonOrdering>Test1</PersonOrdering>
<PhoneNumber>Test Phone</PhoneNumber>
<FaxNumber></FaxNumber>
<Email>test1@test</Email>
<StoreNumber></StoreNumber>
</Contact>
<Badge BadgeNbr="1">
<Line1>rety</Line1>
<PinQuantity>1</PinQuantity>
<MagQuantity>2</MagQuantity>
<Price>12.85</Price>
</Badge>
<Badge BadgeNbr="2">
<Line1>rety</Line1>
<PinQuantity>1</PinQuantity>
<MagQuantity>2</MagQuantity>
<Price>10.00</Price>
</Badge>
<TotalPrice>$22.85</TotalPrice>
<SpecialInstructions></SpecialInstructions>
</Order>
</BadgeOrders>
Heres the code that Ive come up with,
Code:
Dim xmlString As String = ftpsr.ReadToEnd
Dim xmlDataDoc As XmlDocument = New XmlDocument
xmlDataDoc.LoadXml(xmlString)
THANKS A TON
Comment