public String Author
  {
   get
   {
    return Author;
   }
   set
   {
    Author = value;
   }
  }


Author is a property you are assigning Author to a new value within the
set accessor.

Probably it is a typo :-

Try this

Private string author;

public String Author
  {
   get
   {
    return author;
   }
   set
   {
    author = value;
   }
  }

-----Original Message-----
From: Sam Gentile [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 2:15 PM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] Some Basic XML "Serialization" Questions


I'm sorry. I can't figure out from your comment what you mean. I am
generating the xml file now but it is complaining that it is not well
formed because it doesn't have a root element. Do I need to do a
WriteStartDocument and all that? I assumed that XmlSerializer did all
that:

XmlTextWriter xw = new XmlTextWriter("tooldescriptor.xml", null);
    System.Xml.Serialization.XmlSerializer xs
= new XmlSerializer( typeof(ToolDescriptor) );
    xs.Serialize(xw, td);

I also cannot set any of the string properties of my object without
getting stack overflow on this line: td.Author = "Sam Gentile";

which is a property:
public String Author
  {
   get
   {
    return Author;
   }
   set
   {
    Author = value;
   }
  }

Any ideas?

You can read messages from the DOTNET archive, unsubscribe from DOTNET,
or subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to