2
Good morning gentlemen,
I need to read a field that is inside an xml tag but I’m having difficulties, I need to do this to assemble a counter.
My project is to read the XML of a sale and assemble a fiscal coupon from it, but so far I have only managed to pull one item from the sale. Could you help me ?
Structure XML, in case I would need to read the field "nItem" that is in the tag "det", so maybe I could pull all the items:
<det nItem="1">
<prod>
<cProd>7898577370182</cProd>
<xProd>J.WATANABE/COUVE MANTE</xProd>
<vItem>0.99</vItem>
</prod>
</det>
<det nItem="2">
<prod>
<cProd>66396</cProd>
<xProd>GRANEL/ALHO KG</xProd>
<vItem>1.62</vItem>
</prod>
</det>
Structure VB.NET
Dim produto As New BindingSource
produto.DataSource = ds
produto.DataMember = "prod"
Dim descricao As String = produto.Current("xProd").ToString()
Dim quantidade As String = produto.Current("cProd").ToString()
Dim valorprod As String = produto.Current("vProd").ToString()
Is it an NF-e (Brazil)? You have an XML file to read from disk or is it in a string in memory?
– Tony