Re: Passing xml between components
From: Dennis Myrén (dennis_at_oslokb.no)
Date: 03/04/05
- Next message: Mahesh Devjibhai Dhola: "Help - P2P connection in .Net - like Yahoo does for IM"
- Previous message: Dakkar dakkar: "Re: Conflict between .net framework 1.1 and 2.0"
- In reply to: PJChan: "Passing xml between components"
- Next in thread: PJChan: "Re: Passing xml between components"
- Reply: PJChan: "Re: Passing xml between components"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 4 Mar 2005 09:40:40 +0100
I think what might be the problem.
If you write to the MemoryStream, and then want to read what you have
written from the beginning, then you will have to seek the MemoryStream back
to the beginning of stream.
So i think, one line of code might interest you(well, if it is not already
there..):
memoryStream.Seek(0x0, SeekOrigin.Begin);
-- Regards, Dennis JD Myrén Oslo Kodebureau "PJChan" <PJChan@discussions.microsoft.com> wrote in message news:A56AA513-D0B1-43A4-A3D3-135D8CD1C756@microsoft.com... > I'm trying to pass info between two components using xml. To produce the > xml > I'm using an xmltextwriter, and in the receiving end I use an xmldocument > and > its Load method to load the output of the writer. > > If I use an intermedary file I have no problem, but if I use a > MemoryStream > (one of its purposes is to avoid the need for temporary files, right?) > then I > get an error telling me that no root element was found. How could this > be?!! > Does anyone have an example of using a stream to pass xml around? > > While I'm in the subject, what would be the "correct" (or most > appropriate) > way of passing the xml data between components? a string? a stream? an > xmlreader? an xmldocument? > -- > P.J. Chan
- Next message: Mahesh Devjibhai Dhola: "Help - P2P connection in .Net - like Yahoo does for IM"
- Previous message: Dakkar dakkar: "Re: Conflict between .net framework 1.1 and 2.0"
- In reply to: PJChan: "Passing xml between components"
- Next in thread: PJChan: "Re: Passing xml between components"
- Reply: PJChan: "Re: Passing xml between components"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|