All pastes #14444 Raw Edit

Zhila

public text v1 · immutable
#14444 ·published 2005-06-14 03:16 UTC
rendered paste body
<root>
    <Title>Classification</Title>
    <Text>Unnecessary Data</Text>
    <Sections>
        <section type="fruit">
            <a>Apple</a>
            <b>Banana</b>
            <c>Cranberry</c>
        </section>
        <section type="transportation">
            <a>Airplane</a>
            <b>Bus</b>
            <c>Car</c>
        </section>
    </Sections>
</root>

[XmlRoot("root")]
class Foo {
    [XmlElement("Title")]
    public string Title;
    [XmlElement("Text")]
    public string Text;
    [XmlElement("Sections\section")]
    public Section[] section;
}

struct Section {
    [XmlAttribute("type")]
    public string Type;
    [XmlElement("a")]
    public string a;
    [XmlElement("b")]
    public string b;
    [XmlElement("c")]
    public string c;
}