I'm trying to get the list of tblActions from an xmlfile but keep getting nothing.
<?xml version="1.0" standalone="yes"?>
<SecurityDS xmlns="http://tempuri.org/SecurityDS.xsd">
<tblActiveDirectoryConfig>
<AuthenticationEnabled>0</AuthenticationEnabled>
<SSOEnabled>0</SSOEnabled>
<DefaultLoginDomain />
</tblActiveDirectoryConfig>
<tblAccountPolicy>
<PolicyId>1</PolicyId>
<PasswordHistoryPeriod>6</PasswordHistoryPeriod>
<MinPassword>3</MinPassword>
<MaxPassword>30</MaxPassword>
<LoginAttemptsAllowed>3</LoginAttemptsAllowed>
<PasswordExpiration>60</PasswordExpiration>
</tblAccountPolicy>
<tblAction>
<ActionID>1</ActionID>
<ActionName>Adjust(w/ value)</ActionName>
<ActionSeqID>10</ActionSeqID>
<CreateDate>2002-07-15T17:49:18.1470000-05:00</CreateDate>
<ModifyDate>2002-07-15T17:49:18.1470000-05:00</ModifyDate>
</tblAction>
<tblAction>
<ActionID>2</ActionID>
<ActionName>State0(ex. Unoccupied for BV, BO)</ActionName>
<ActionSeqID>20</ActionSeqID>
<CreateDate>2002-07-15T17:53:03.4900000-05:00</CreateDate>
<ModifyDate>2002-07-15T17:53:03.4900000-05:00</ModifyDate>
</tblAction>
<tblAction>
<ActionID>3</ActionID>
<ActionName>State1(ex. Occupied for BV, BO)</ActionName>
<ActionSeqID>21</ActionSeqID>
<CreateDate>2002-07-15T17:53:14.4470000-05:00</CreateDate>
<ModifyDate>2002-07-15T17:53:14.4470000-05:00</ModifyDate>
</tblAction>
</<SecurityDS>
My Xpath I've tried:
- .//tblAction
- //tblAction
- /SecurityDS/tblAction
My code snippet :
XmlNode root = fileContents.DocumentElement;
var nodes = root.SelectNodes(xpath_value);
In all cases I get zero nodes selected.