Tom Sage
asked on
XML and Linq - reading fields in repeating nodes
Hello, I have an XML with repeating nodes that I am trying to read with Linq. Here is sample XML
Thanks for any help
<Tax>
<TaxType>Monthly Use</TaxType>
<TaxDescription>Monthly Use</TaxDescription>
<TaxAmount>34.01</TaxAmount>
<TaxRate>9.00000</TaxRate>
</Tax>
<Tax>
<TaxType>CapCostReduction</TaxType>
<TaxDescription>CapCostReduction</TaxDescription>
<TaxAmount>128.83</TaxAmount>
<TaxRate>5.00000</TaxRate>
</Tax>
Here is my Linq code so far. Dim doc As XDocument = XDocument.Load(inFile)
Dim taxSegs As IEnumerable(Of String) =
From seg In doc...<Tax>
Select desc = seg...<Tax>.Where(Fuction(x) x.Name = "TaxDescription").Value
Thanks for any help
And your question is?
ASKER
Sorry it was not clear - I am getting an error with the LINQ query above.
On the x.Name, the x is underlined with this message: Comma, ')', or valid expression continuation expected.
On the x.Name, the x is underlined with this message: Comma, ')', or valid expression continuation expected.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.