开发者

DataContract/DataMember multiple elements in xml

I have an XML like this:

<data>
    <foo>some value</foo>
    <result>...</result>
    <result>...</result>
    <result>...</result>
    ...
</data>

I would like to deserialize it with DataContr开发者_如何学Goact/DataMember.. I know how to handle the array/collection of results elements if they were embedded inside a parent object like:

    <data>
    <foo>some value</foo>
    <collectionOfResults>
            <result>...</result>
            <result>...</result>
            <result>...</result>
            ...
    </collectionOfResults>
    </data>

But I don't know how to do it without the embedding element. Do you?


If you need to control the format of the XML, then you don't want to use the DataContractSerializer. Use the XML Serializer instead.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜