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: Peter Flynn
Date: Sun, 27 Jul 2008 21:14:24 +0100
Newsgroups: comp.text.xml

junyang@xxxxxxxxx wrote:
> On Jul 26, 4:40 pm, Peter Flynn <peter.n...@xxxxxxxxxxxxx> wrote:
[snip]
>> 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.

It's usually far easier to manage if you make base.dtd the external
entity referenced by the DOCTYPE Declaration, and let users add their
own selection of a, b, ... using a PE in the internal subset.

<!DOCTYPE whatever SYSTEM "/some/uri/for/base.dtd" [
<!ENTITY % a "INCLUDE">
]>

and do all your entity management and file inclusion in base.dtd, a.ent,
b.ent, or whatever.

///Peter

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