Hello friends,
I have to get the data of a specific node from a deserialised XML object.
Below is the deserialization code snippet:
XmlSerializer deserializer = new XmlSerializer(typeof(ABC));
TextReader reader = new StreamReader(strSrcFilename);
object obj = deserializer.Deserialize(reader);
XmlData = (ABC)obj;
Here is the XML snippet:
</<pre lang="xml"><?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<ABC xmlns="http://www.abc.net/schema/ABC/r1.0">
<CATEGORY>TestReport</CATEGORY>
<ADMIN-DATA>
<LANGUAGE>DE</LANGUAGE>
<USED-LANGUAGES>
<L-10 xml:space="preserve" L="EN">EN</L-10>
</USED-LANGUAGES>
<DOC-REVISIONS>
<DOC-REVISION>
<REVISION-LABEL>1.0.0.1</REVISION-LABEL>
<STATE>under_develpment</STATE>
<TEAM-MEMBER-REF DEST="TEAM-MEMBER">/EBAX/rm</TEAM-MEMBER-REF>
<DATE>2015-03-27</DATE>
</DOC-REVISION>
<DOC-REVISION>
<REVISION-LABEL>1.0.0.0</REVISION-LABEL>
<STATE>under_develpment</STATE>
<TEAM-MEMBER-REF DEST="TEAM-MEMBER">EBAX/rm</TEAM-MEMBER-REF>
<DATE>2015-03-25</DATE>
</DOC-REVISION>
</DOC-REVISIONS>
</ADMIN-DATA>
<PROJECT-DATA>
<PROJECT-DATA>
</ABC>
Below is the class structure of ABC Class:
public partial class ABC: object, System.ComponentModel.INotifyPropertyChanged {
public NMTOKENSTRING CATEGORY;
[System.Xml.Serialization.XmlElementAttribute("ADMIN-DATA")]
public ADMINDATA ADMINDATA;
[System.Xml.Serialization.XmlElementAttribute("PROJECT-DATA")]
public PROJECTDATA PROJECTDATA;
[System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)]
public SDG[] SDGS;
[System.Xml.Serialization.XmlAttributeAttribute()]
public string S;
[System.Xml.Serialization.XmlAttributeAttribute()]
public string T;
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
public partial class ADMINDATA : object, System.ComponentModel.INotifyPropertyChanged {
public LENUM LANGUAGE;
[System.Xml.Serialization.XmlElementAttribute("USED-LANGUAGES")]
public MULTILANGUAGEPLAINTEXT USEDLANGUAGES;
[System.Xml.Serialization.XmlArrayAttribute("COMPANY-DOC-INFOS")]
[System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)]
public COMPANYDOCINFO[] COMPANYDOCINFOS;
[System.Xml.Serialization.XmlArrayAttribute("DOC-REVISIONS")]
[System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)]
public DOCREVISION[] DOCREVISIONS;
[System.Xml.Serialization.XmlArrayItemAttribute(IsNullable=false)]
public SDG[] SDGS;
[System.Xml.Serialization.XmlAttributeAttribute()]
public string S;
[System.Xml.Serialization.XmlAttributeAttribute()]
public string T;
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string propertyName) {
System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
if ((propertyChanged != null)) {
propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
}
}
Now I need to extract the "ADMIN-DATA" data from the XmlData object.
Please suggest how to do that.
Thanks