views:

145

answers:

1

How to read XHTML with XDocument, without downloading DTD. How to resolve the DTD references? No, you can't just say:

settings.ProhibitDtd = false;
settings.XmlResolver = null;

as given in some previous answer, which is absolutely wrong. What about the entities then:   Also I am not interested in HTMLAgility pack, again wrong answer, as I have valid XHTML.

A: 

Found the solution, you have to manually cache all the DTD (see Mauricio Scheffer comment above), it looks like the best solution:

http://msdn.microsoft.com/en-us/library/bb669135.aspx

http://www.koders.com/csharp/fid94A10BEBC204E95FF8C314E657E2E4DA86B5BEFD.aspx?s=httpwebrequest#L50

http://www.codeproject.com/KB/XML/HTML2XHTML.aspx

Priyank Bolia