Re: Assemblies and Directories

Bob Stayton <[email protected]> Tue, 15 Nov 2022 12:07:28 -0800
Newsgroups gmane.text.docbook.apps
Message-ID <[email protected]>
--------------aVPDZHJ0OkacT405eqgSFhqO
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

The DocBook XSL stylesheets have some of the machinery for correcting 
relative references from an assembled document, but there is a piece not 
yet implemented.

Before the assembly element was added to DocBook, people used XInclude 
to create a document from modular source files located in different 
directories.  The XInclude processor adds an xml:base attribute to the 
root of an element pulled from another directory to indicate where it 
came from in the source files.  The DocBook XSL stylesheets know how to 
resolve such nested xml:base attributes to fix relative references to 
graphics and cross references in the assembled document.

So assemble.xsl would need to be modified to insert xml:base attributes 
in the temporary document it assembles.  The information for xml:base 
would come from the resource elements in the assembly.  Then when the 
temporary document is processed the relative references would be merged 
with the xml:base information to produce the correct output.

I'd be interested in helping with this if you can provide testing. It is 
certainly a feature that is needed.

Bob

On 11/14/2022 8:34 PM, Philo Calhoun wrote:
> With DITA topics and a DITA bookmap, I can easily have topics in 
> logical directories and create a pdf target that works.
>
> I tried doing the same thing in a Docbook Assembly and encountered 
> problems. I put the Docbook topics in various subdirectories which 
> basically corresponded to chapter titles. If any of the Docbook topics 
> had relative references to images, crossrefs, etc, these no longer 
> worked when I made an assembly target, as it created a new 
> "Untitiled.xml" file where the references and cross-references were no 
> longer correct. Rather than just dumping all the docbook topics 
> together in the same directory as the docbook assembly, is there a way 
> of working so that the links don't get broken? 
--------------aVPDZHJ0OkacT405eqgSFhqO
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font size="2"><font face="Helvetica, Arial, sans-serif">Hi,</font></font></p>
    <p><font size="2"><font face="Helvetica, Arial, sans-serif">The
          DocBook XSL stylesheets have some of the machinery for
          correcting relative references from an assembled document, but
          there is a piece not yet implemented.</font></font></p>
    <p><font size="2"><font face="Helvetica, Arial, sans-serif">Before
          the assembly element was added to DocBook, people used
          XInclude to create a document from modular source files
          located in different directories.  The XInclude processor adds
          an xml:base attribute to the root of an element pulled from
          another directory to indicate where it came from in the source
          files.  The DocBook XSL stylesheets know how to resolve such
          nested xml:base attributes to fix relative references to
          graphics and cross references in the assembled document.  <br>
        </font></font></p>
    <p><font size="2"><font face="Helvetica, Arial, sans-serif">So
          assemble.xsl would need to be modified to insert xml:base
          attributes in the temporary document it assembles.  The
          information for xml:base would come from the resource elements
          in the assembly.  Then when the temporary document is
          processed the relative references would be merged with the
          xml:base information to produce the correct output.</font></font></p>
    <p><font size="2"><font face="Helvetica, Arial, sans-serif">I'd be
          interested in helping with this if you can provide testing. 
          It is certainly a feature that is needed.<br>
        </font></font></p>
    <p><font size="2"><font face="Helvetica, Arial, sans-serif">Bob</font></font><br>
    </p>
    <div class="moz-cite-prefix">On 11/14/2022 8:34 PM, Philo Calhoun
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:[email protected]">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <span style="caret-color: rgb(51, 51, 51); color: rgb(51, 51, 51);
        font-family: robotoregular, Arial, Helvetica, sans-serif;
        font-size: 13.65px; background-color: rgb(255, 255, 255);">With
        DITA topics and a DITA bookmap, I can easily have topics in
        logical directories and create a pdf target that works. </span><br
        style="box-sizing: border-box; caret-color: rgb(51, 51, 51);
        color: rgb(51, 51, 51); font-family: robotoregular, Arial,
        Helvetica, sans-serif; font-size: 13.65px;">
      <br style="box-sizing: border-box; caret-color: rgb(51, 51, 51);
        color: rgb(51, 51, 51); font-family: robotoregular, Arial,
        Helvetica, sans-serif; font-size: 13.65px;">
      <span style="caret-color: rgb(51, 51, 51); color: rgb(51, 51, 51);
        font-family: robotoregular, Arial, Helvetica, sans-serif;
        font-size: 13.65px; background-color: rgb(255, 255, 255);">I
        tried doing the same thing in a Docbook Assembly and encountered
        problems. I put the Docbook topics in various subdirectories
        which basically corresponded to chapter titles. If any of the
        Docbook topics had relative references to images, crossrefs,
        etc, these no longer worked when I made an assembly target, as
        it created a new "Untitiled.xml" file where the references and
        cross-references were no longer correct. Rather than just
        dumping all the docbook topics together in the same directory as
        the docbook assembly, is there a way of working so that the
        links don't get broken?</span>
    </blockquote>
  </body>
</html>

--------------aVPDZHJ0OkacT405eqgSFhqO--