Hi there,
I have two xml files, one is a master file and the other is just a fragment
of xml. Master xml file uses 'DOCTYPE' to define the other file as an
entity. Then, the master uses entity references that are supposed to be
expanded into real content at parsing time. Examples are provided below.
When I open master xml file in InternetExplore r , IE shows correct content.
All the entities are transformed into right xml. So far I have been
unsuccessfull in getting similar result when I try to do the same
programmaticall y using C#. I was trying to use XmlDocument and
XmlValidatingRe ader but I am getting exceptions at the moment when I expect
entity reference to be transformed into correct content.
Is there a generic way [in C#] of expanding all the entities into real
content so when I read my xml I can get the content, not exceptions. Is it
possible at all ? If so, could anyone point me to an example that deals
with this issue ?
Thank you,
Mark.
Example of master file:
<!DOCTYPE inclusion [<!ENTITY inclX SYSTEM "fragment.x ml">] >
<root>
<element1>thi s is element 1</element1>
&inclX;
</root>
Example of "fragment.x ml" content:
<element2>thi s is element 1</element2>
<element3>thi s is element 1</element3>