Hi I using XmlTextReader to read policy files generated by the iPhone Configuration Utility 3.6 when the reader reaches the doctype element it will hang up for about 15-20 seconds. This is a huge problem for me because i need to read 60 files at a time and it reads each file 3 times. Here is some code I have and a sample file that you can use to repeat the problem.
private int findStart(String d)
{
Boolean StartLooking = false;
using (XmlTextReader xr = new XmlTextReader(d))
{
while (xr.Read())
{
if (xr.NodeType.Equals(XmlNodeType.Element) && xr.Name.Equals("dict") && !StartLooking)
StartLooking = true;
else if (xr.NodeType.Equals(XmlNodeType.Element) && xr.Name.Equals("dict") && StartLooking)
return xr.LineNumber;
}
xr.Close();
}
return -1;
}
XML File: AdvancedPayload.mobileconfig (Dropboxlink)
Please reply if you know why this hangup occurs. Thanks