I'm getting stumped by what I hope is a simple problem. I'm trying to embed a simple formula incrementing a variable to act as a "line number" for an XML document. Writing literal XML in visual basic. Here's what the code looks like:
<%= From d In orderData
Select <ItemOut quantity=<%= d.OrderQuantity %> lineNumber=<%= i %>>
<ItemID>
<SupplierPartID><%= d.VendorPartNo %></SupplierPartID>
</ItemID>
<ItemDetail>
<UnitPrice>
<Money currency="USD"><%= d.PricePerPackage %></Money>
</UnitPrice>
<Description xml:lang="en"><%= d.Description %></Description>
<UnitOfMeasure><%= d.OrderUOM %></UnitOfMeasure>
</ItemDetail>
<%= i = i + 1 %>
</ItemOut>
%>
I was expecting each iteration of d in OrderData to tick i + 1, however, it is simply returning "false". See the output XML here:
<ItemOut quantity="1" lineNumber="1">
<ItemID>
<SupplierPartID>99999</SupplierPartID>
</ItemID>
<ItemDetail>
<UnitPrice>
<Money currency="USD">0.00</Money>
</UnitPrice>
<Description xml:lang="en">Tub and Tile Caulk Biscuit</Description>
<UnitOfMeasure>cs</UnitOfMeasure>
</ItemDetail>false</ItemOut>
<ItemOut quantity="1" lineNumber="1">
<ItemID>
<SupplierPartID>999999</SupplierPartID>
</ItemID>
<ItemDetail>
<UnitPrice>
<Money currency="USD">0.00</Money>
</UnitPrice>
<Description xml:lang="en">Tub and Tile Caulk Almond</Description>
<UnitOfMeasure>cs</UnitOfMeasure>
</ItemDetail>false</ItemOut>
Is it possible to do this sort of thing? I even tried making a call to a function instead:
lineNumber=<%= incrementI(i) %>>
But that also results in "false" as the output. What am I missing here? Thank you for your help in advance!
Visual Studio 2013
No comments:
Post a Comment