473,326 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Converting C# object to XmlElement object.

Hi everyone,

the class XmlSerializer provides a generic way to convert a
C# object to a XML file. Does anybody know a similar way
to convert a C# object to a XmlDocument or XmlElement object
without writing the content to an external file?

I am using a XML DOM tree as a sort of in-memory "database":
various components of our application saves their states into
certain sub-trees of the DOM tree.

thanks,

James X. Li
Nov 12 '05 #1
1 5584


James X. Li wrote:

the class XmlSerializer provides a generic way to convert a
C# object to a XML file. Does anybody know a similar way
to convert a C# object to a XmlDocument or XmlElement object
without writing the content to an external file?


You can serialize to a memory stream and then create the XmlDocument
from the memory stream.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sean | last post by:
Hi, I am facing a problem, and i don't know why the error is being generated. I am updating a datagrid with an XML file. My code is Protected Sub UpdateCommand(ByVal Sender As Object,...
1
by: Kristian Kjems | last post by:
Look at the Code Snippet below: It is not possible to Deserialize the Animal in animalStr directly because the type of the animal is not known. Deserializing into the abstract type will not work...
2
by: John Bowman | last post by:
Hi, I need to sign a specific node in an XML file that contains analytical data & has a structure something like the following: <DOCUMENT> <RESULT_SET> <TESTVAL> </TESTVAL> ...
3
by: Adam Stephensen | last post by:
http://msdn.microsoft.com/msdnmag/issues/04/10/ServiceStation/ In the downloadable code (not the article itself) for this great article about WSE Security, Aaron Skonnard has the following C#...
0
by: Vijay Cinnakonda | last post by:
I have a web service that takes in object as a parameter , outlined as below. public IList EvaluateRules(object containerObject) The object expected is a flat object with just fields like
5
by: Antanas | last post by:
Hi folks. I need unique sequence object generated for each row returned form select statement. Here is my ADDID() UDF: CREATE FUNCTION DB2ADMIN.ADDID() RETURNS CHAR(6) NOT DETERMINISTIC F1:...
0
by: Igor | last post by:
Hi everyone ! I have a problem with object serialization. I created web service with number of methods. One of them receives object of the next type: public class ObjectClass private szValue...
1
by: bullrout | last post by:
Hi There, I have a method which uses some values passed in as xml, at times some of the elements in the document will be null. The document itself has many elements and I wanted to handle the null...
3
by: Jeremy | last post by:
I've created a serializable class and put attributes around all the properties that should be serialized. I return the class from a web service, but my problem is that the wsdl for the web service...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.