Konrad Rokicki wrote:
Hi,
I don't know if this is even possible, but:
I have an read-only XML file (report.xml) with a DTD that just defines
some entities. I want to add some entities to this DTD but I can't
change the file.. the solution I'm trying at the moment is to build
another file with my own DTD, then XInclude the original file. I
thought it might merge the DTD's but it doesn't seem to work. Is there
any way to accomplish this, or does anyone have an alternative
solution?
Thanks,
Konrad

Konrad,

Here's my interpretation of your problem and a possible solution:

 Original file (report.xml):

   <!DOCTYPE report SYSTEM "report.dtd">
   <report>
       <data>Here's some &euml;bermensch data.</data>
   </report>

 Original DTD (report.dtd):

   <!-- begin Report DTD -->
   <!ELEMENT report ( data* )>
   <!ELEMENT data ( #PCDATA )*>
   <!ENTITY euml "&#235;">
   <!-- end DTD -->

and you want to modify the available declarations in the DTD
without modifying either file. Change the name of "report.dtd"
to something else, say "report_orig.dtd". Then create a new
DTD file like this:

 New version of report.dtd:

   <!-- begin New Report DTD -->
   <!ELEMENT % report_orig SYSTEM "report_orig.dtd">
   %report_orig;
   <!ENTITY eacute "&#233;">
   <!ENTITY ecirc  "&#234;">
   <!-- end DTD -->

In this way, report.xml calls your new DTD, which in turn calls
the original.

If you want to redefine anything in the original DTD, you
pre-declare any of its contents prior to instantiating it.
Other than that, anything declared after its instantiation
is appended to the list of declarations.

Hope this helps,

Murray

......................................................................
Murray Altheim                    http://kmi.open.ac.uk/people/murray/
Knowledge Media Institute
The Open University, Milton Keynes, Bucks, MK7 6AA, UK               .

  The Pentagon announced that the US death toll had reached 1,001 -
  three of them civilian contractors - since US-led forces moved in
  to Iraq to topple Saddam Hussein 18 months ago. The number of
  wounded had reached 7,000. The White House paid tribute to those
  who had lost their lives. "We remember, honour and mourn the loss
  of all those that made the ultimate sacrifice defending freedom,"
  said US presidential spokesman Scott McClellan.

  He added that the best way to honour them was to continue waging the
  war on terror making "the world a safer place and make America more
  secure". -- http://news.bbc.co.uk/1/hi/world/middle_east/3636340.stm

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to