> Is there any combination of serialization attributes that can accomplish this,
> or do I have to use a custom XML serializer? BTW, I'm using Visual Studio
> 2008.
SOAP serialization does allow references I think. It will however not
have the format you describe.
The new DataContractSerializer in .NET 3.5 also allows references to
objects. Here is an example from MSDN:
------------------------- quote -------------------------------------
For these reasons, some DataContractSerializer constructor overloads
have a preserveObjectReferences parameter (the default is false). When
this parameter is set to true, a special method of encoding object
references, which only WCF understands, is used. When set to true, the
XML code example now resembles the following.
<PurchaseOrder ser:id="1">
<billTo ser:id="2"><street ser:id="3">123 Main St.</street></billTo>
<shipTo ser:ref="2"/>
</PurchaseOrder>
----------------------- quote ----------------------------------------
The documentation is here:
http://msdn.microsoft.com/en-us/library/ms731073.aspx

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Niklas Deutschmann - 13 May 2008 09:17 GMT
Hi Martin,
> The new DataContractSerializer in .NET 3.5 also allows references to
> objects. Here is an example from MSDN
So, if I'm understanding it correctly, with this kind of serialization, I
cannot choose the attributes for ID and reference myself? I would like to say
that "code" is the identifying attribute of "Airport", for instance, and that
any reference to an "Aiport" should be encoded as an ID reference with the
"code" attribute of this "Aiport".
Regards,
Niklas