Click here to Skip to main content
15,891,204 members
Home / Discussions / C#
   

C#

 
Generalwriting good unit tests Pin
steven shingler10-Jun-04 1:26
steven shingler10-Jun-04 1:26 
GeneralRe: writing good unit tests Pin
Colin Angus Mackay10-Jun-04 1:58
Colin Angus Mackay10-Jun-04 1:58 
GeneralRe: writing good unit tests Pin
steven shingler10-Jun-04 3:39
steven shingler10-Jun-04 3:39 
GeneralRe: writing good unit tests Pin
Marc Clifton10-Jun-04 10:10
mvaMarc Clifton10-Jun-04 10:10 
GeneralReading Serial Device (How To?) Pin
Ariadne10-Jun-04 0:05
Ariadne10-Jun-04 0:05 
GeneralRe: Reading Serial Device (How To?) Pin
Stefan Troschuetz10-Jun-04 0:28
Stefan Troschuetz10-Jun-04 0:28 
Generalxmldocument and xhtml = sloooow Pin
Roger Alsing9-Jun-04 23:20
Roger Alsing9-Jun-04 23:20 
GeneralRe: xmldocument and xhtml = sloooow Pin
Heath Stewart10-Jun-04 6:45
protectorHeath Stewart10-Jun-04 6:45 
You should read the documentation for the XmlResolver property and class, which would answer your questions. Yes, for fully-trusted code (by default, code executed on and from your machine) the XmlDocument.XmlResolver is an XmlUrlResolver and will resolve DTDs. So, either extend XmlResolver or XmlUrlResolver and override ResolveUri so that it doesn't fetch external resources. Do override (unless you extend XmlUrlResolver, which already does this) GetEntity so that entities are resolved. Instantiate your implementation and set that as the XmlDocument.XmlResolver.

Here's a problem, though - if that entity is defined in the DTD (since XHTML doesn't define entities like  ) then you can't resolve it.

You could, however, attempt to resolve common entities (can be found on the W3C web site) as well as decimal and hexidecimal entities for character encoding, like &#XX; and &#xXX;. If the content author tries to include content using an entity, though, you'll have a problem (perhaps in this case you could fetch the DTD) before returning from your method - it may work).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: xmldocument and xhtml = sloooow Pin
Roger Alsing10-Jun-04 23:37
Roger Alsing10-Jun-04 23:37 
GeneralRe: xmldocument and xhtml = sloooow Pin
Heath Stewart11-Jun-04 2:53
protectorHeath Stewart11-Jun-04 2:53 
GeneralLife of application Pin
quocbao9-Jun-04 21:55
quocbao9-Jun-04 21:55 
GeneralRe: Life of application Pin
Alex Getman10-Jun-04 1:24
Alex Getman10-Jun-04 1:24 
GeneralRe: Life of application Pin
Wackatronic10-Jun-04 4:55
Wackatronic10-Jun-04 4:55 
GeneralRe: Life of application Pin
Dave Kreskowiak10-Jun-04 4:56
mveDave Kreskowiak10-Jun-04 4:56 
GeneralThe file associated with FileStream Pin
Meysam Mahfouzi9-Jun-04 21:40
Meysam Mahfouzi9-Jun-04 21:40 
GeneralRe: The file associated with FileStream Pin
Heath Stewart10-Jun-04 4:25
protectorHeath Stewart10-Jun-04 4:25 
QuestionHow to add image property to UserControl? Pin
luming11223344559-Jun-04 21:38
luming11223344559-Jun-04 21:38 
AnswerRe: How to add image property to UserControl? Pin
partyganger10-Jun-04 3:10
partyganger10-Jun-04 3:10 
AnswerRe: How to add image property to UserControl? Pin
Heath Stewart10-Jun-04 4:20
protectorHeath Stewart10-Jun-04 4:20 
GeneralRe: How to add image property to UserControl? Pin
luming112233445510-Jun-04 14:37
luming112233445510-Jun-04 14:37 
Generalsend mail Pin
ChangAli9-Jun-04 21:06
ChangAli9-Jun-04 21:06 
GeneralRe: send mail Pin
Heath Stewart10-Jun-04 4:16
protectorHeath Stewart10-Jun-04 4:16 
GeneralRe: ListView Pin
myNameIsRon9-Jun-04 20:44
myNameIsRon9-Jun-04 20:44 
GeneralRe: ListView Pin
Alex Getman10-Jun-04 1:29
Alex Getman10-Jun-04 1:29 
GeneralRe: ListView Pin
Serge Lobko-Lobanovsky10-Jun-04 2:08
Serge Lobko-Lobanovsky10-Jun-04 2:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.