Cancelled

How to get xpath with indexing to update XML file dynamically C#

I would like to know how to get xpath with indexing in c# dynamically .

XML FILE

<?xml version="1.0" encoding="UTF-8"?>

<breakfast_menu>

<food>

<name>Belgian Waffles</name>

<price>5.95</price>

<price>7.5</price>

<price>9.9</price>

<description>

Two of our famous Belgian Waffles with plenty of real maple syrup

</description>

<calories>650</calories>

</food>

<food>

<name>Strawberry Belgian Waffles</name>

<name>Strawberry Belgian Waffles Mini</name>

<name>Strawberry Belgian Waffles Full</name>

<price>7.95</price>

<description>

Light Belgian waffles covered with strawberries and whipped cream

</description>

<calories>700</calories>

</food>

<food>

<name>Berry-Berry Belgian Waffles</name>

<name>Berry-Berry Belgian Waffles Mini</name>

<name>Berry-Berry Belgian WafflesFull</name>

<price>8.95</price>

<description>

Belgian waffles covered with assorted fresh berries and whipped cream

</description>

<calories>900</calories>

</food>

<breakfast_menu>

MY output

Belgian Waffles my xPath== "breakfast_menu/food/name"

5.95 my xPath== "breakfast_menu/food/price"

7.5 my xPath== "breakfast_menu/food/price"

9.9 my xPath== "breakfast_menu/food/price"

Strawberry Belgian Waffles my xPath== "breakfast_menu/food/name"

Strawberry Belgian Waffles Mini my xPath== "breakfast_menu/food/name"

Strawberry Belgian Waffles Full my xPath== "breakfast_menu/food/name"

I want output like this

Belgian Waffles my xPath== "breakfast_menu/food[1]/name"

5.95 my xPath== "breakfast_menu/food/price[1]"

7.5 my xPath== "breakfast_menu/food/price[2]"

9.9 my xPath== "breakfast_menu/food/price[3]"

Strawberry Belgian Waffles my xPath== "breakfast_menu/food[2]/name[1]"

Strawberry Belgian Waffles Mini my xPath== "breakfast_menu/food[2]/name[2]"

Strawberry Belgian Waffles Full my xPath== "breakfast_menu/food[2]/name[3]"

Skills: .NET, C# Programming, XML

See more: load xml file dynamically radgrid, read attribute xml file php, flex dynamically create form based xml file, dynamically assign xml file flash, reading xml file xpath aspnet, use xpath read xml file, asp read xml file xpath, read xml file using xpath vbnet, loading images dynamically flash dynamic xml file, searching xml file xpath aspnet, reading xml file vbnet xpath, net read xml file xpath, read xml file attribute vbnet, net xpath parse xml file, aspnet read xml file xpath

About the Employer:
( 1 review ) bangalore, India

Project ID: #17115668