By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,460 Members | 1,508 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,460 IT Pros & Developers. It's quick & easy.

ignoring <!DOCTYPE

P: n/a
I am trying to ignore the <!DOCTYPE ...element when I Read() an xml
file with my XmlReader. Setting "ProhibitDtd" to true makes Read()
generate an error. Catching the error does not help because it makes
further Read()s fail and return false. Setting "ProhibitDtd" to false
forces the XmlReader to fetch the DTD from an external website which
is highly undesirable in my application. Removing the <!DOCTYPE...>
element prior to creating the XmlReader is not an option either
because the application processes thousands of xml files across
network traffic at any given time and this will slow it down to an
unusable state.
Is there a way around this?
Thanks in advance for your help.
Jul 3 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
jake wrote:
I am trying to ignore the <!DOCTYPE ...element when I Read() an xml
file with my XmlReader. Setting "ProhibitDtd" to true makes Read()
generate an error. Catching the error does not help because it makes
further Read()s fail and return false. Setting "ProhibitDtd" to false
forces the XmlReader to fetch the DTD from an external website which
is highly undesirable in my application. Removing the <!DOCTYPE...>
element prior to creating the XmlReader is not an option either
because the application processes thousands of xml files across
network traffic at any given time and this will slow it down to an
unusable state.
Create your own Reader/Stream that read the entire XML file
but skip the DTD and does not return it to the XmlReader.

Maybe not a pure design, but simple enough.

Arne
Jul 3 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.