List Info

Thread: XML Serialization...




XML Serialization...
user name
2006-07-12 16:46:32
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-DOTNETDISCUSS.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Ū  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

XML Serialization...
user name
2006-07-12 18:20:21
Thank you very much!

That's exactly what I was needing.  Worked like a charm. 


Thanks,
Mike


On 7/12/06, Jef Newsom <jnewsomgeniant.com> wrote:
>
> 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-DOTNETDISCUSS.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 DevelopMentorŪ  http://www.develop.com

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

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )