Getting XML as a string

Getting XML as a string

Post by Bert Sirki » Sun, 09 Jun 2002 01:31:50



I've created some XML, and see how I can save it to a file with the
XMLDocument "save" method, but how can it be retrieved as a string without
first saving it?

TIA,
bert

 
 
 

Getting XML as a string

Post by Christoph Schittk » Sun, 09 Jun 2002 01:58:40


You've got a few options there, saving to a MemoryStream or accessing the
InnerXml property are just two of them ... I very much recommend the
quickstart tutorials as well as the "Employing XML in the .NET Framework"
section under "Programming with the .NET Framework" in the Framework SDK
docs.

HTH,
--
Christoph Schittko
Software Architect
Mshow - a division of InterCall


Quote:> I've created some XML, and see how I can save it to a file with the
> XMLDocument "save" method, but how can it be retrieved as a string without
> first saving it?

> TIA,
> bert


 
 
 

Getting XML as a string

Post by Bert Sirki » Sun, 09 Jun 2002 02:52:58


Thanks - it does help!

bert


> You've got a few options there, saving to a MemoryStream or accessing the
> InnerXml property are just two of them ... I very much recommend the
> quickstart tutorials as well as the "Employing XML in the .NET Framework"
> section under "Programming with the .NET Framework" in the Framework SDK
> docs.

> HTH,
> --
> Christoph Schittko
> Software Architect
> Mshow - a division of InterCall



> > I've created some XML, and see how I can save it to a file with the
> > XMLDocument "save" method, but how can it be retrieved as a string
without
> > first saving it?

> > TIA,
> > bert

 
 
 

1. XML Newbie question, getting a value from an XML string

I have a web service that returns an xml string:
<USERS>
   <UserID>1</UserID>
   <FirstName>Mark</FirstName>
   <LastName>Moeykens</LastName>
</USERS>

So now that I have this string, how do I find out what the value is for the
field "UserID"?

Just to let you know I have no experience with XML so if you reply with
something like "Just use DOM" I still won't know what to do.

If it is easier I can have the web service return a string like this too:
<USERS UserID="1" FirstName="Mark" LastName="Moeykens"/>

I've been working at this for the last 3 hours and am getting overwhelmed by
the whole XML world.

I've managed to read the string into an XmlDocument object but that's about
it.

Thanks,
Mark Moeykens

2. Resetting counter

3. Book issues on Persistence and Activation

4. Getting XML document string out of XmlReader

5. Software to make CD list?

6. XmlReader to an XML string and then return the string

7. Expecting "text/xml" and getting "text/xml" + utf-8 encoding

8. How to i split a string by string not char[], using String.Split()

9. Getting String Hex representation of 2bit Bitmap

10. Getting the String Collection editor for another property

11. COM bstr to CLR string; final byte gets truncated!