G
Guest
I'm having trouble understanding XPath syntax
string pth = "/Settings/Puzzle/something where name is equal to Alpha"
node = doc.SelectSingleNode(pth)
Obviously I want the <Puzzle> node whose name attribute is "Alpha" but I do not know how to express that with XPath syntax. How do I do that? (xml file is below)
Thanks,
Jo
<?xml version="1.0" encoding="utf-8" ?><Settings><Current>Alpha</Current><Puzzle name="Alpha"><Divisor>786</Divisor><Quotient>4579</Quotient><Dividend>3599094</Dividend></Puzzle><Puzzle name="Beta"><Divisor>867</Divisor><Quotient>5479</Quotient><Dividend>4750293</Dividend></Puzzle><Puzzle name="Gamma"><Divisor>793</Divisor><Quotient>6842</Quotient><Dividend>5425706</Dividend></Puzzle></Settings>
string pth = "/Settings/Puzzle/something where name is equal to Alpha"
node = doc.SelectSingleNode(pth)
Obviously I want the <Puzzle> node whose name attribute is "Alpha" but I do not know how to express that with XPath syntax. How do I do that? (xml file is below)
Thanks,
Jo
<?xml version="1.0" encoding="utf-8" ?><Settings><Current>Alpha</Current><Puzzle name="Alpha"><Divisor>786</Divisor><Quotient>4579</Quotient><Dividend>3599094</Dividend></Puzzle><Puzzle name="Beta"><Divisor>867</Divisor><Quotient>5479</Quotient><Dividend>4750293</Dividend></Puzzle><Puzzle name="Gamma"><Divisor>793</Divisor><Quotient>6842</Quotient><Dividend>5425706</Dividend></Puzzle></Settings>