Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > ArrayList XmlSerialization Question

Reply
Thread Tools

ArrayList XmlSerialization Question

 
 
Raed Sawalha
Guest
Posts: n/a
 
      04-04-2005
I have the following
a class with ArrayList member

[XmlInclude(typeof(keyword))]
public class Info
{
Info(){data = new ArrayList();}

public ArrayList keyword;
public void Add(string sData)
{
keyword key;
key = new keyword();
key.data = sData;
data.Add(key);
}
public string SerializeObject(object oClassObject,System.Type oClassType)
{
XmlSerializer oSerializer = new XmlSerializer(oClassType);
System.Text.StringBuilder strBuilder = new System.Text.StringBuilder();
System.IO.TextWriter writer = new System.IO.StringWriter(strBuilder);
oSerializer.Serialize(writer,oClassObject);
return strBuilder.ToString();
}

in my aspx page i called
Info oInfo = new Info();
oInfo.Add( "Key1 ");
oInfo.Add( "Key2 ");
string str = oInfo.SerializeObject(oInfo,typeof(Info));

after XML Generation in the keyword section i got like this

- <keyword>
- <anyType xsi:type="keyword">
<LangString>key1</LangString>
</anyType>
- <anyType xsi:type="keyword">
<LangString>key2</LangString>
</anyType>
</keyword>

how can I get result like following
<keyword>
<LangString>key1</LangString>
</keyword>
<keyword>
<LangString>key2</LangString>
</keyword>
each keyword in independent element, is this possible
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XMLSerialization - appending blocks to existing xml file Frank ASP .Net 1 03-06-2007 04:26 AM
XmlSerialization base classes =?Utf-8?B?Q2hyaXMgU3phYm8=?= ASP .Net 5 01-20-2006 09:16 PM
XmlSerialization error No one ASP .Net 2 06-18-2005 05:35 PM
XmlSerialization Problem =?Utf-8?B?UmFlZCBTYXdhbGhh?= ASP .Net 0 11-28-2004 02:51 PM
XMLSerialization: Sometimes csc.exe freezes on the PermissionSet =?Utf-8?B?QSBwcm9ncmFtbWVyIGRlc3BlcmF0bHkgbmVlZGluZyBoZWxwIQ==?= ASP .Net 0 11-18-2004 11:28 AM



Advertisments