Is the property read-only?  If it's read-only, I don't think the XML
serializer will be able to "set" it upon deserialization so it won't
serialize it.

--
Patrick Steele
Microsoft .NET MVP
http://weblogs.asp.net/psteele



-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Mike Andrews
Sent: Wednesday, July 12, 2006 3:26 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] XML Serialization...


I'm having a new problem now.

I can't get one of my properties that returns a single object to
serialize. When I serialized just that object, it worked fine, but it
won't do it now that it's a property of a higher level object.

Any suggestions?

Thanks,
Mike


On 7/12/06, Jef Newsom <[EMAIL PROTECTED]> wrote:
>
> D'oh -
> Itchy trigger finger:
>
> class Patient {
>
> [
> XmlArray("Allergies"),
> XmlArrayItem("Allergy", typeof(Allergy))
> ]
> public IList Alergies{ get{} set{}}
>
> }
>
>
> ________________________________
>
> From: Jef Newsom
> Sent: Wed 7/12/2006 11:46 AM
> To: Discussion of advanced .NET topics.
> Subject: RE: [ADVANCED-DOTNET] XML Serialization...
>
>
> class Patient {
> [XmlArray("Allergy", typeof(Allergy)]
> public IList Alergies{ get{} set{}}
>
> }
>
> ________________________________
>
> From: Discussion of advanced .NET topics. on behalf of Mike Andrews
> Sent: Wed 7/12/2006 10:50 AM
> To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
> Subject: [ADVANCED-DOTNET] XML Serialization...
>
>
>
> Guys,
>
> I have a serialization question that I need help with.
>
> I have and object that I'm serializing and I've got that to work. Now,

> the object has some collection properties.  However when it serializes
> it, it produces output similar to this:
>
>
> <Patient ...>
> ....
> <allergies id="63af378a-9fdb-4716-9cf7-c79f666085c1" code="A1"
> description="Test" /> <allergies
> id="158ed678-f7c3-4e5e-8948-3183b4318430" code="A2" description="Test"

> /> <diagnosisCodes id="1e97d2e8-eee8-44ae-8bcd-e0e63cd7bbe1"
> code="DC1" description="Test" />
> <diagnosisCodes id="684e93b2-5429-466a-932b-633c5097658f" code="DC2"
> description="Test" />
> </Patient>
>
> However, I need it to produce output similar to this:
>
> <patient...>
> ....
> <allergies>
> <code id="" code="" description="" />
> <code id="" code="" description="" />
> </allergies>
> <diagnosisCodes>
> <code id="" code="" description="" />
> <code id="" code="" description="" />
> </diagnosisCodes>
> </patient>
>
> How might I do this?
>
> Thanks,
> Mike
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>

===================================
This list is hosted by DevelopMentorR  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to