Name for serialized class

K

Karl

Given:

// A test object that needs to be serialized.
[Serializable()]
public class TestSimpleObject {




What attribute should I use if I wanted to serialize the above as simply
"SimpleObject"?

I tried XmlRoot() and that didn't change the name of the class for me.

TIA.
 
K

Karl

Thank you. But that doesn't change anything for me. Is there some secret?

Here's the XML
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Calc xmlns="pine-grove.com">
<Cash_Flow_Data Version="string">
<Periodic_Frequency>int</Periodic_Frequency>
<Compounding_Frequency>int</Compounding_Frequency>
<Nominal_Annual_Rate>double</Nominal_Annual_Rate>
<Points_Percentage>double</Points_Percentage>
<Points_Amount>double</Points_Amount>
<Days_Prepaid_Interest>int</Days_Prepaid_Interest>
<Other_Charges>double</Other_Charges>
<Notes>string</Notes>


Maybe XmlRootAttribute is the wrong .net attribute?

[Serializable]
[System.Xml.Serialization.XmlRootAttribute("StateRootXmlNode")]
public class StateObject


I have a complete Xml Serialize example at my blog:
http://spaces.msn.com/sholliday/ 9/21/2005 entry






Given:

// A test object that needs to be serialized.
[Serializable()]
public class TestSimpleObject {




What attribute should I use if I wanted to serialize the above as simply
"SimpleObject"?

I tried XmlRoot() and that didn't change the name of the class for me.

TIA.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top