Hello! First, let me say that I’m still new to Unity, and to Mono/.NET, so I apologize if I’m doing something obviously wrong.
myXmlReader = new XmlTextReader("http://fraticelli.info/temp/test.xml");
while ( myXmlReader.Read() ) {
print( myXmlReader.ReadString() );
}
I’m trying to load XML off the web, and read through it with an XmlTextReader object. The code seems to work (there are no errors), except, every line read from the file is blank – there are 11 blank lines in my console after loading a 12-line XML file. (There were 8 blank lines for a 9-line XML file.)
The same thing happens whether I create the XmlTextReader with the URL of the file, or whether I fetch that URL into a WWW object and create the XmlTextReader with a StringReader containing the data of the loaded WWW object. It’s clearly reading the file, because the length of the While loop corresponds to how many lines are in the XML file (minus 1)…
Is there something obvious I’m doing wrong? Am I not converting the mono strings into javscript strings, or something?
Thank you!