How do I access the URI of the DTD file on my local machine?

I have a DTD file that I accessed from this link:

http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd

      

Now I want to be able to access this file on my local machine without any internet access. I used WebRequest to access this URI.

Can any of you tell me how to access it using a dictionary or any other class in C #.

Thanks..

0


a source to share


1 answer


This is usually a function of your XML parser. Find something called an "object handler". When a DOCTYPE declaration is declared, this handler is called to load the DTD. It will receive the URL and some other information as parameters.

[EDIT] The object handler returns some kind of "stream" that the XML parser will read. Therefore, you need to save the DTD to a file, open the file in an object handler, and return the resulting stream to an XML parser.



Your XML parser documentation should have examples on how to do this. Note that the stream must be closed somewhere; usually the XML parser does this (since only it knows when it is done with the stream).

0


a source







All Articles