Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xmlTextReader + block of xml

Status
Not open for further replies.

jkresh

Programmer
Apr 13, 2007
1
US
I have some code which manipulates a number of large xml files using xmldoc, as such it is slow and something of a memory hog. I have been asked to move most of the xmldoc code to xmltextreader and xmltextwriter and for the most part the conversion is going ok but I am running into a problem. At some point in the code it currently has something like

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(value);

where value is a short xml string ie "<elem>some text<child/>more text<child/>additional text</elem>"

(or something like that)

is there anyway to get that into a xmltextreader (outside of writing it to a file and reading the file)?
The project is running on vs.net2003 (though if 2005 would be a major boost in speed or make this easier I could probably convince them to buy it). None of the constructors I have seen for xmltextreader seem to allow that. I guess since the xml is so short it might be fine to leave this part as an xmldoc as storing it in memory is not an issue but... Thanks for any suggestions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top