I'm trying to construct a class that would map with this XML structure, but can't figure out how. I've seen examples here where I can use [XmlText] if the element value is a string. In my case, the element value is boolean. How should I construct my "Service" class?
(I think) I know how to take care of the "Services" element :-). It's just an array of "Service" objects. I'm just not sure how to build the "Service" class.
<?xml version="1.0" encoding="utf-8"?>
<Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MyConfigs>
<Services>
<Service Name="ServiceName">true</Service>
</Services>
</MyConfigs>
I have this:
[XmlArray("Services")]
[XmlArrayItem("Service")]
public Service[] Services { get; set; }
And this:
public class Service
{
[XmlAttribute]
public string Name { get; set; }
// How do I get the boolean value here?????
}