[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [docbook-apps] DTD customizations for XIncludes: How to add X Includes support for row in tbody?
Unfortunately, redefining element declarations does not work. The validator will complain about duplicate element declarations, and likely ignore it. This is a case where customizing the DocBook DTD is harder than it should be. Normally element declarations in DocBook are enclosed in marked sections with INCLUDE as the magic word to control whether the marked section is on or off. If your customization changes the magic word to IGNORE, then the original declaration is left out and you are free to declare the element your way. But tbody is in the calstblx.dtd file, and none of those element declarations are in such marked sections. Further compounding the problem, the tbody element's content model is hardwired as (row+), and does not use a parameter entity in any way. That means you also cannot overrule a parameter entity to change the content model for tbody. AFAICT, the only way to make this change is to copy the calstblx.dtd file to a new name, edit it to make the change, and make sure you DTD customization file uses that edited version. Here is a DTD customization that changes the parameter entity that references the calstblx.dtd file so instead in references a modified "mytblx.dtd" file, then pulls in the stock DocBook DTD, and adds the XInclude element declarations: !ENTITY % tablemodel PUBLIC "-//NOT-OASIS//DTD DocBook Modified CALS Table Model V4.2//EN" "mytblx.dtd"> <!ENTITY % docbook PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "docbookx.dtd"> %docbook; <!ELEMENT xi:include (xi:fallback?) > <!ATTLIST xi:include xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude" href CDATA #REQUIRED parse (xml|text) "xml" encoding CDATA #IMPLIED > <!ELEMENT xi:fallback ANY> <!ATTLIST xi:fallback xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude" > Then you can use this customized DTD in place of the stock DocBook DTD. But it might just be easier to validate your documents after XIncludes have been processed. The --postvalid option to xmllint will do that. It's the only way to make sure the resulting document is still valid. Bob Stayton 400 Encinal Street Publications Architect Santa Cruz, CA 95060 Technical Publications voice: (831) 427-7796 The SCO Group fax: (831) 429-1887 email: email@example.com Quoting Jeff Beal <firstname.lastname@example.org>: > I think you can just re-define the tbody element in your local subset > as > follows: > > <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook 4.2//EN" > "http://www.oasis-open.org ... " [ > <!ELEMENT tbody (row | xi:include)+> > ]> > > I've never done this to re-define elements, but I think it will work. > > Jeff > > > -----Original Message----- > > From: Stubbe Paul [mailto:email@example.com] > > Sent: Monday, July 07, 2003 11:49 AM > > To: firstname.lastname@example.org > > Subject: [docbook-apps] DTD customizations for XIncludes: How to add > > XIncludes support for row in tbody? > > > > > > I try to adapt the dtd based on > > http://www.sagehill.net/docbookxsl/ValidXinclude.html. > > > > I'am a small scale docbook user with an xsl customization > > layer but I have no experience customizing the dtd. > > > > I'm responsible for the publishing proces and my writers are > > reusing rows in different tables. > > > > I got the publishing proces to work based on: > > <tbody> > > <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" > > href="reusefile.xml#xpointer(//table[@id='reuseID']/tgroup/tbo > > dy/*)" /> > > <row> > > ... > > </row> > > </tbody> > > > > Is there a "right" or better way to reuse row-level information? > > > > But I do this in an ugly way by preprocessing the content > > file with ant and regular expressions. <row > role="reuse">reuseID</row> > > This preprocessing-step I would like te eliminate. > > > > > > So what I think needs to be done is to change the dtd so that > > an editor accepts and proposes the xi:include within tbody. > > > > The problem I have is that I do not find a parameter entity > > like "local.tbody. .." that I can overrule. > > > > In what direction should I look for a solution? > > > > Thanks, > > > > Paul > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > email@example.com > > For additional commands, e-mail: > > firstname.lastname@example.org > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: email@example.com > For additional commands, e-mail: > firstname.lastname@example.org > > >