开发者

Replace anyType node from List<Object> xml serialization

so I'm serializing an object that contains a List<开发者_JAVA技巧;Object> property, and it serializes it like this:

<Explorer xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Name>Explorer1</Name>
  <Items>
    <anyType xsi:type="FolderObject">
      <Name>Folder1</Name>
      <Items>
        <anyType xsi:type="MyObject">
          <Name>Object 1</Name>
        </anyType>
      </Items>
    </anyType>
    <anyType xsi:type="MyObject">
      <Name>Object 2</Name>
    </anyType>
  </Items>
</Explorer>

So what I want to do is replace the anyType node with some other name. Is that possible?

Thanks.


Have you the the XmlElement attribute on the class?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜