This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: DBHTML dir "attribute"


I was hoping I was missing some little trick that would make everything
magically work.  Alas . . .

Jeff Beal
Ansys, Inc.
(724)514-3150
jeff.beal@ansys.com

-----Original Message-----
From: Bob Stayton [mailto:bobs@caldera.com]
Sent: Monday, March 18, 2002 4:31 PM
To: Jeff Beal; DocBook Mailing List (E-mail)
Subject: Re: DOCBOOK-APPS: DBHTML dir "attribute"

On Mon, Mar 18, 2002 at 03:07:46PM -0500, Jeff Beal wrote:
> I'm trying to create chunked HTML output using subdirectories.  I've used
> the dbhtml processing instruction, and the files are created correctly,
but
> none of the link within the documentation are working.  It seems that the
> stylesheets are putting the directory name into the href regardless of
where
> the current file resides.
> 
> My file looks like this:
> <book id="home">
>  <?dbhtml filename="Home.htm"?>
>  <title>Help</title>
>  <chapter id="overview">
>   <?dbhtml filename="Overview.htm" dir="Overview"?>
>   <title>Overview</title>
>   <sect1 id="more>
>     <?dbhtm filename="more.htm" dir="Overview"?>
>     .
>     .
>     .
>    </sect1>
>  </chapter>
>  <chapter id="something">
>   <?dbhtml filename="Something.htm" dir="Something"?>
>  </chapter>
> </book>
> 
> This creates the following file / directory structure:
> 
> Home.htm
> Overview
>             Overview.htm
>             More.htm
> Something
>             Something.htm
> 
> However, links from Something.htm to Overview.htm are <a
> href="Overview/Overview.htm"/> and not <a
href="../Overview/Overview.htm"/>
> 
> I'm using the XSL 1.48 stylesheets and Saxon for my XSLT processor.
> 
> Does anyone have this working correctly using XSL?

I don't believe this is possible with the current 
stylesheets, because there is no detection of where
the xref is coming "from", so it cannot compute
a relative path.

An HREF value in a link is computed using the
named template 'href.target', which for chunk output is
defined in chunk-common.xsl.  That template
calls 'chunk-filename', which is the same template
used to define the output filename.  As you found out, chunk-filename
does use the dbhmtl information.
But href.target doesn't do anything else with chunk-filename
except append the '#id' to its result if it needs to.
So all the HREFs end up looking relative to the
start directory, not relative to each other.

If you want to customize that behavior, you should
modify href.target from chunk-common.xsl.  I'm not sure
how hard it would be to compute a relative path
for arbitrary depths of dbhtml-dir values. 
Perhaps you could simplify it for your customization
if your output is just one level down.
Something like "if my closest ancestor dbhtml-dir
value doesn't match the target dbhtml-dir value,
then prepend ../ ". 

--

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
Caldera International, Inc.                 fax:   (831) 429-1887
                                            email: bobs@caldera.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]