OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] validating individual files in a document

Ah, so your book is using system entities to assemble the book. A system entity is not allowed to have its own DOCTYPE, as you discovered. That limitation was one of the reasons XInclude was invented. I discuss this general issue at the start of my chapter on Modular documentation.


If you can convert the book to use XInclude instead, you could add a DOCTYPE to each module and validate the book and the modules individually.

Short of that, you could create "shadow" files. For each system entity, create an XML document consisting of a DOCTYPE and a reference to that system entity. You could validate each of those. Since they don't contain any content, they don't require updates as the book progresses. And your book still references the system entities, not the shadow files.

Bob Stayton
Sagehill Enterprises

On 7/17/2016 5:35 PM, Joseph Mingrone wrote:
Hi Bob,

Bob Stayton <bobs@sagehill.net> writes:
Hi Joseph,
If you can put a DOCTYPE declaration at the top of the included file, then you
must be using XInclude and not system entity references to assemble your
document.  If you are using XInclude, it is not an error to define the entities
in DOCTYPES in both the main document and the included document.  The rules are
described in this section of my online book on DocBook XSL:


There's also a section on managing such shared entity declarations:


and lots of other tips on using XInclude.

I can put a DTD at the top of the included file and it validates in Emacs.

<!DOCTYPE book [
<!ENTITY % prompt.user SYSTEM "../../../../share/xml/freebsd.ent">  %prompt.user;
<!ENTITY % man.csh.1   SYSTEM "../../../../share/xml/man-refs.ent"> %man.csh.1;

But, if I do that, putting the book together by running make on the supplied
Makefile fails.

It does not look like this book is using XInclude.

<books/fdp-primer> % grep -ir xinclude .

returns nothing.

Is there a way, other than creating a DTD in the included file, to satisfy the
validator when it's only validating that included file?

Maybe I'll look into configuring nxml-mode to ignore the missing entity



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]