473,241 Members | 2,005 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,241 software developers and data experts.

Serializing object graph directly to XML document rather than to text

Is there a way to serialize a graph of objects and get the output as an XML
document, without first serializing to text and then parsing the text (I
know how to do this but I find it really silly and inefficient).

I googled around and from what I found, the answer is NO. Am I missing
something obvious? Is there something new coming in .NET 2.0?

Of course, I'm also interested in the reverse operation (deserializing
directly from XmlDocument rather than from text).

Bruno
Nov 12 '05 #1
3 1877


Bruno Jouhier wrote:
Is there a way to serialize a graph of objects and get the output as an XML
document, without first serializing to text and then parsing the text (I
know how to do this but I find it really silly and inefficient).


I am not sure what you mean with XML document here, if you serialize you
usually serialize to a stream or file and then you have an XML document
there in that file respectively the file is an XML document.
Or are you talking about System.Xml.XmlDocument and want to convert some
graph of objects into an instance of System.Xml.XmlDocument?
--

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

"Martin Honnen" <ma*******@yahoo.de> a écrit dans le message de news:
uT**************@TK2MSFTNGP14.phx.gbl...


Bruno Jouhier wrote:
Is there a way to serialize a graph of objects and get the output as an
XML document, without first serializing to text and then parsing the text
(I know how to do this but I find it really silly and inefficient).
I am not sure what you mean with XML document here, if you serialize you
usually serialize to a stream or file and then you have an XML document
there in that file respectively the file is an XML document.
Or are you talking about System.Xml.XmlDocument and want to convert some
graph of objects into an instance of System.Xml.XmlDocument?


Of course, I mean an instance of XmlDocument (or XmlElement).


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Nov 12 '05 #3
More on this: I needed this because I have a web service with a WebMethod
that returns an XmlNode (this is a generic method that may return different
graphs for different types of objects, I have another method that returns
the associated schema so the client knows what he is dealing with).

I think that I have found my solution:
http://weblogs.asp.net/cazzu/archive...rformance.aspx

But still, it would be nice if there were a simple API to convert back and
forth between graphs of objects and XmlElement.

Bruno
Nov 12 '05 #4

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

Similar topics

2
by: Steve Darby | last post by:
Hi all! I wonder if anyone can help with a problem I am having with a sctipt I have written. It uses the information stored in a cookie to generate a bar graph of sales for a range of cooking...
1
by: mattoc | last post by:
Happy new year to all. I have a strange error that I've been trying for a while now to fathom.. Basically I have a hierarchy of state classes that I need to serialize to XML. Some of them can...
1
by: Ivo Bronsveld | last post by:
All, I have quite a challenging task ahead of me. I need to write an object model (for code access) based on a schema, which cannot be made into a dataset because of it's complexity. So I...
2
by: Tobias Zimmergren | last post by:
Hi, just wondering what serializing really is, and howto use it? Thanks. Tobias __________________________________________________________________ Tobias ICQ#: 55986339 Current ICQ status: +...
1
by: Tjerk Wolterink | last post by:
I have created an W3C XML DOM in java, it uses namespaces. Now i want to serialize it to the outputstream: === Document document=retrievePageDocument(page, manager.getDataStore());...
22
by: Cylix | last post by:
I have a 4row x 1col table, I would like to drop all the content of row three. Since Mac IE5.2 does not suppport deleteRow method, I have also try to set the innerHTML=''; but it does not work. ...
17
by: Jef Driesen | last post by:
Suppose I have a datastructure (actually it's a graph) with one template parameter (the property P for each edge and vertex): struct graph<P>; struct vertex<P>; struct edge<P>; I also have...
3
by: Leeh | last post by:
I'm new to the world of RDF and RDF/XML so pardon my naive question: I understand that the "real" RDF model is the conceptual network of nodes (Subjects and Objects) connected by predicate arcs;...
12
by: Cagdas Ozgenc | last post by:
Greetings, When directly serializing C++ structures to a file with the standard library functions giving the address of the data and length of structure using the sizeof operator, do I risk...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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
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...

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.