Main Site Documentation



Hi all, Is there a way to use XmlReader with a string containing the XML document ?



You can put string into a stream and use the stream object with XmlReader.


Create the XmlReader from a Stream object like so:

      string s = "Some valid XML";
      byte[] bytes = Encoding.UTF8.GetBytes (s);
      MemoryStream ms = new MemoryStream (bytes);
      XmlReader reader = XmlReader.Create(stream); 

Word of warning - XML is a memory hog and you can quickly eat up all the smaller FEZ boards have to offer.


Thanks you very much guys


I used XML as well in the past. I now moved to JSON, feels much lighter :wink:


Json makes it easier for javascript to parse. Xml is still a better choice if you want something universal.