tags:

views:

147

answers:

1

Hi Everyoone,

i have a DTD file which i used to accessed through this link:

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

Now i want that i should be able to access this file on my local machine without any web access.I was using WebRequest to access this URI.

Can any of you tell me how to access it using Dictionary or any other Class in C#.

Thanks..

A: 

This is usually a feature of your XML parser. Search for something called "entity handler". When a DOCTYPE declaration is found, this handler is called to load the DTD. It will get the URL and some other information as parameters.

[EDIT] The entity handler will return some kind of "stream" which the XML parser will read. So you need to save the DTD to a file, open the file in the entity handler and return the resulting stream to the XML parser.

There should be examples in the documentation of your XML parser how to do this. Note that the stream must be closed somewhere; usually the XML parser does that (since only it knows when it's done with the stream).

Aaron Digulla
Ok,Thanks but how can i access it on my local system?
crazy_itgal