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] DTD customizations for XIncludes: How to addXIncludes support for row in tbody?

Hi Paul,

We have just been working on this ourselves, because we are working out
how to use the XSL stylesheets with our SGML source.  It involves
converting SGML to XML using osx, then applying the stylesheets. 
However, the XSL processor we are using, xsltproc, needs to use
Xincludes to bring in <programlisting>s from external files.  So we
followed Bob Stayton's book, as you have.

> I try to adapt the dtd based on http://www.sagehill.net/docbookxsl/ValidXinclude.html.

The problem for us is changing the SGML mark-up, which looks like this:

      <imagedata format="linespecific" fileref="filename.ext">

To Xinclude format:

  <xi:include  href="filename.ext" parse="text"

We did this by running our XML source through a small XSL stylesheet:

<?xml version='1.0'?>
<xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 

  <!-- Copies the whole tree, with attributes. -->
  <xsl:template match="node()|@*">
    <xsl:copy><xsl:apply-templates select="node()|@*"/></xsl:copy>

  <!-- Changes markup for programlisting. -->
  <xsl:template match="programlisting">

	<!-- Get the filename -->
    <xsl:variable name="fref" 

	<!-- Create the opening tag -->

	<!-- Write all pre-filename Xinclude markup -->
      <xsl:text disable-output-escaping="yes">&lt;xi:include 

	<!-- Write the filename -->
      <xsl:value-of select="substring($fref, 4)"/>

	<!-- Write all post-filename Xinclude markup -->
      <xsl:text disable-output-escaping="yes">&quot; 

	<!-- Create the closing tag. -->


You can probably do something similar for <row role="include-this">
elements in your code.

However, in your situation, I would simply define an entity for each row
that you want to include, and then include the entity file in each
document.  For example, in your code, you would have something like
  <title>The Blahs</title>
  <tgroup cols="3">
      <row><entry>Local Blah</entry></row>
      <row><entry>Local Blah</entry></row>

At the top of your document, in the DTD declaration, you would have a
line like this:

<!ENTITY % my_entities SYSTEM "my_entities.sgml"> %my_entities;

This lets you put all your entities into a separate file, which any
document can have access to.  The contents of the my_entities.sgml file
would look something like this:

<!entity blah_text_1 "Universal Blah">

Hope that helps,



> 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/tbody/*)" />
> <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: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
Robert McIlvride, Cogent Real-Time Systems, Inc.
robert@cogent.ca  (888) 628-2028  www.cogent.ca

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