I am trying to access the node <accessmode>
in the xml for a specific <action>
.
<controller name="Job">
<roles>
<role>1</role>
<role>3</role>
<role>4</role>
</roles>
<actions>
<action name="Index">
<roles>
<role>1</role>
<role>4</role>
</roles>
<accessmode>1</accessmode>
</action>
<action name="Warning">
<roles>
<role>1</role>
<role>3</role>
</roles>
<accessmode>3</accessmode>
</action>
</actions>
</controller>
I tried with the below code.
private string mode;
[XmlArrayItem(ElementName = "action")]
[XmlElement(ElementName = "accessmode")]
public string Mode
{
get { return mode; }
set { mode = value; }
}
Since the <accessmode>
is an element under the arrayitem of I tried so.
But, I am getting the value as null. Any help will be appreciated.