File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes SAX for C#? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SAX for C#?" Watch "SAX for C#?" New topic

SAX for C#?

Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Does anyone know of an open source effort to produce a SAX/DOM processor in C#?
Here's something amusing... As part of .NET, Microsoft supplies an XmlTextReader class that works as a pull processor. It should work perfectly for any size XML file since all it does is read the file and pass the next node you request. It is a forward-only read-only processor. For some reason, the genius who wrote the code decided to process everything as an offset from the beginning of the file. And furthermore, this genius decided to store that offset as an int. This means that if your XML file is larger that Int32.MaxInt the program craps out! MS acknowledges the error but it won't be fixed anytime soon.
Be amused by the code here:

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1167
But let’s just look at the numbers -
2^32 bytes =
2^24 KBs =
2^16 MBs =
2^8 GBs =
2^0=1 TB
So, one terabyte of XML seems to me quite sufficient for most purposes.

William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
It's actually 2^31 - 1
That a little over 2 gig. We have a 6 gig XML file that we are trying to process and we can't unless we either split the file or write our own XML processor. Thus my question about a SAX processor for C#.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1167
You are right!
Let me try again -
2^32 bytes =
2^22 KBs =
2^12 MBs =
2^2=4 GBs
Positive/Negative for int. So exactly 2GB.
[ October 11, 2002: Message edited by: Dan Drillich ]
Guennadiy VANIN
Ranch Hand

Joined: Aug 30, 2001
Posts: 898
The Microsoft SAX2 implementation provides both Microsoft� Visual Basic� and Microsoft Visual C++� interfaces.
It is difficult to imagine because all Web developers for MS platform were using VBScript and will continue, in the nearest future.
Even I, as SPJP2, have difficulty because Visual Studio.NET have all examples/samples (in MSDN and Helps) on WEB/XML development only for jscript, VBScript, VC++, VB, that are not even compatible with .NET platform.
Please correct me, where I am wrong
I agree. Here's the link:
subject: SAX for C#?
Similar Threads
Fresher ! need help
SoDuko puzzle
Parsing XML Document with SAX
SHA1 source code
Searching with SAX in xml