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: [docbook-apps] [docbook-xsl] relative links in chunked HTML


On Tue, Jun 03, 2003 at 03:50:33PM +0200, Peter Klotz wrote:
> Hi,
> 
> how can one influence the links that are generated in chunked HTML with
> the DocBook XSL stylesheets? I use base.dir to define the location where
> the chunked files are generated and that works fine, but the links are
> still refering to the document without this path.
> 
> So even if I set base.dir=work/test and the chunker writes its files into
> work/test/index.html e.g. links in index.html are refering to
> ch01s12.html#N10102. I would like to at least get a link to
> work/test/ch01s12.html#N10102 or some other prefix that I can set.

There isn't a built-in prefix for hrefs that you can add.

But I don't understand why you need a prefix at all.
A relative URL is taken as relative to the address of
the calling file.  A link from an address
"http://somehost/work/test/index.html";
to a relative URL href="ch01s12.html#N10102" should be resolved
by the browser to
"http://somehost/work/test/ch01s12.html#N10102";.

If href="work/test/ch01s12.html#N10102",
then the browser would be requesting
"http://somehost/work/test/work/test/ch01s12.html#N10102";.
Or else I'm missing something.

> I'm using this inside Cocoon and the prefix needs to be something that I 
> can use to choose the pipeline. "test" would be a variable directory 
> coming from a parameter, so with only ch01s12.html I don't know in which 
> directory the files are.

So Cocoon is doing something with the files that make
normal relative URLs not work, right?
Can you give an example?

Since there is no parameter for such a prefix, you'll have
to customize one of the DocBook templates to add it.
Take a look at the "href-target-uri" template in 
html/chunk-common.xsl.  It generates the href
for all cross reference targets.  You should be
able to add a new parameter as a prefix
to the path if you need it.  Then pass the parameter
value when you call the stylesheet customization.

-- 

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: bobs@sco.com

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


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