Niklas Deutschmann wrote:
Quote:
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
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/