Hi,
If I have an XML file that stores its data in a hierarchical relationship,
is there a way to automatically "flatten" this relationship when I
deserialize it (using the XmlSerializer) to a collection of objects?
For example, assume that I have an XML file that contains the following data
for lastnames/firstnames:
Anderson
Bob
Ann
Jones
Betty
Fred
Mark
Smith
Paul
Gina
I'd like to deserialize this file into a set of "Person" objects, with each
Person containing both a lastname and firstname (rather than separate
"LastName" and "FirstName" objects in a hierarchical relationship):
Anderson, Bob
Anderson, Ann
Jones, Betty
Jones, Fred
Jones, Mark
Smith, Paul
Smith, Gina
Is there any Framework way to do this automatically (perhaps by using an
attribute), or do I need to write custom deserialization code to do this?
Many thanks.
Cowboy \(Gregory A. Beamer\) - 21 Oct 2003 20:58 GMT
Deserialize and run through an XSLT stylesheet that gives you what you are
looking for. With XSLT, this exercise will be fairly easy and fast.

Signature
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
**********************************************************************
Think Outside the Box!
**********************************************************************
> Hi,
>
[quoted text clipped - 31 lines]
> attribute), or do I need to write custom deserialization code to do this?
> Many thanks.
Robert Jacobson - 21 Oct 2003 21:23 GMT
It looks like that will do the trick. Thanks!
"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
message news:uqb4c5AmDHA.3320@tk2msftngp13.phx.gbl...
> Deserialize and run through an XSLT stylesheet that gives you what you are
> looking for. With XSLT, this exercise will be fairly easy and fast.
[quoted text clipped - 36 lines]
> > attribute), or do I need to write custom deserialization code to do this?
> > Many thanks.