I have some *performance* trouble reading MathML files in my application (in
ASP.Net).
- I have small MathML files (2-3k) as input
- as (almost) all MathML files these use entities. I have no way to restrict
the entities used.
- to read an XML file entities into a document, you need to use a DTD, or
you get an exception (any other way ?)
- The MathML DTD is HUGE (2400+ Entities, ~300k of files), loading it in a
document is a big CPU and file access hog, specially for a ASP.net
application. As you see the DTD is easilly a hundred times bigger than the
file to load.
I tried to pay the price only once by caching an empty XmlDocument and
reusing it as a template, but doc.Clone() is also a big CPU hog, and trying
:
doc = docIn.Implementation.CreateDocument();
XmlNode n = doc.ImportNode( docIn.DocumentType, true );
to initialise the DTD is better but still intensive.
Any ideas on a better way to handle XmlDocument with a large number of
entities ? Pointers ? Suggestions ?
Thanks in advance.