Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

deserialize using class base

$
0
0

hello guys need some help regarding deserialization of xml using class and xmlserialize.deserialize without using linq

<Person><Name>Emmanuel</Name><Age>24</Age><BasicDetails Gender="Male"><Mobile>09435188068</Mobile><Address><Address1>1769 Ford St</Address1><Address2>Culdesac Sunvalley</Address2><City>Parañaque</City></Address></BasicDetails></Person>

and my class is

[XmlRoot("Person")]
    public class Person
    {
        /// <remarks/>
        public string Name { get; set; }

        /// <remarks/>
        public int Age { get; set; }

        /// <remarks/>
        public List<BasicDetails> BasicDetails { get; set; }
    }
    [XmlRoot("BasicDetails")]
    public class BasicDetails
    {
        /// <remarks/>
        public int Mobile { get; set; }

        /// <remarks/>
        public List<Address> Address { get; set; }

        /// <remarks/>
        [XmlAttribute("Gender")]
        public string Gender { get; set; }
    }
    [XmlRoot("Address")]
    public class Address
    {
        /// <remarks/>
        public string Address1 { get; set; }

        /// <remarks/>
        public string Address2 { get; set; }

        /// <remarks/>
        public string City { get; set; }
    }

i can only pull the data via xml root but on the nested node i cannot make it

thanks and godbless in advance


auwi


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>