comp.text.xml
[Top] [All Lists]

Re: Problems with multiple multiple-level inclusion of DTDs

Subject: Re: Problems with multiple multiple-level inclusion of DTDs
From:
Date: Sun, 27 Jul 2008 12:21:29 -0700 PDT
Newsgroups: comp.text.xml

On Jul 26, 4:40 pm, Peter Flynn <peter.n...@xxxxxxxxxxxxx> wrote:
>
> The technique is to use parameter-entity switches.
>
> In a.dtd:
>
> <!ENTITY % use.base.from.a "INCLUDE">
> <![%use.base.from.a;[
> %include.base;
> <!ENTITY % use.base.from.b "IGNORE">
> ]]>
>
> In b.dtd
>
> <!ENTITY % use.base.from.b "INCLUDE">
> <![%use.base.from.b;[
> %include.base;
> <!ENTITY % use.base.from.a "IGNORE">
> ]]>
>
> This way, whichever one you invoke first will prevent the other one from
> being activated.

This would work, except that now a.dtd would need to know about b.dtd,
and vice versa, which is difficult to keep manage if there are many
potential includers of base.dtd...

> Better would be to paramaterise a and b alone, and invoke your base in
> your document type declaration with a PE switch to include whichever or
> a and b (or both) that you require for the instance.

This is what I am doing for now, though users of a.dtd and b.dtd have
to manually manage inclusion.

Another possibility I thought of is to have an exclude-base-
includers.dtd file that sets all PE switches to false. This file would
be included by base.dtd. Each includer of base.dtd would set the its
own PE switch to true, and then include base.dtd. End users are hidden
from all this mess, but the downside of this approach is that the
exclude-base-includers.dtd file needs to be maintained.

--- Jun Y.

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy