Groups | Blog | Home
all groups > dotnet xml > february 2005 >

dotnet xml : Overruling embedded DTD



Søren M. Olesen
2/24/2005 11:51:18 AM
Hi

Is there a way to overrule the entity settings in an embedded DTD when using
xmlreader??

TIA

Søren



Derek Harmon
2/24/2005 9:51:28 PM
[quoted text, click to view]

Subclass the XmlReader. Then while your consumer is calling Read( )
on your XmlReader-subclass, some of the nodes received will have a
NodeType of XmlNodeType.EntityReference.

When that happens, check the LocalName. This will tell you the name
of the entity, and then you can take control of what it gets resolved to
(either by substituting your own EntityResolver for the one being used,
or injecting additional nodes into what your XmlReader-subclass will
read in lieu of what the Entity would've been resolved as from the DTD).


Derek Harmon

AddThis Social Bookmark Button