Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XmlTextReader Exception

0 views
Skip to first unread message

Annmarie

unread,
Sep 12, 2002, 11:20:31 AM9/12/02
to
I'm using XmlTextReader to read a large (6 gig +) xml file
and am running across the following error a third of the
way through the file:

Error type...........: System.IndexOutOfRangeException:
Index was outside the bounds of the array.
at System.Xml.XmlTextReader.SetElementValues()
at System.Xml.XmlTextReader.ParseElement()
at System.Xml.XmlTextReader.Read()
at GetXMLFragment.CountXMLElements.getCounts()
Error description....: Index was outside the bounds of the
array.
Stack trace..........: at
System.Xml.XmlTextReader.SetElementValues()
at System.Xml.XmlTextReader.ParseElement()
at System.Xml.XmlTextReader.Read()
at GetXMLFragment.CountXMLElements.getCounts()

My code is as follows: (I've stripped it bare in an
attempt to isolate the problem)

XmlTextReader reader = null;
try
{
reader = new XmlTextReader(inputFileStream);
while (reader.Read())
{
totalReads++;
}
}
catch (Exception e)
{
reader.Close();
inputFileStream.Close();
//other exception stuff
}

It crashes on the 9477524 read. If I extract a subset of
the xml data (including the record it crashed on) and send
them through the code as a separate xml file I don't get
an exception.

Has anyone encountered this problem before? Is it a bug
within the XmlTextReader.

Any help would be greatly appreciated.

Thanks in advance.
Annmarie

Dare Obasanjo

unread,
Sep 12, 2002, 2:29:11 PM9/12/02
to
Due to a limitation in the XmlTextReader (which uses an int to specify a
particular offset) it cannot read files bigger than 2 GB. This should be
fixed in a future release.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Annmarie" <azie...@fala.com> wrote in message
news:10f4801c25a6f$eea2c6b0$35ef2ecf@TKMSFTNGXA11...

Annmarie

unread,
Sep 12, 2002, 2:59:32 PM9/12/02
to
Thanks.

I noticed the refereneces to Int, but I needed a 'sanity
check' to be sure that it was a XmlTextReader limitation
and not my code.

When you say future release, does that mean the release
that is scheduled for the end of this year or further in
the future?

Thanks again.
Annmarie

>.
>

Dare Obasanjo

unread,
Sep 12, 2002, 3:43:45 PM9/12/02
to
Further in the future.

Sorry. :(

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Annmarie" <azie...@fala.com> wrote in message

news:112d401c25a8e$87483f30$35ef2ecf@TKMSFTNGXA11...

0 new messages