Re: DOCBOOK-APPS: link from HTML to docbook HTML

2001-08-09 Thread Bob McIlvride

klaas holwerda wrote:
 
 But in case of the first section within a chapter, the first section is
 placed on the same page as the chapter and
 its table of contents, so no seperate file.
 Therefore  next question would be how can i control that (certain)
 sections get placed on seperate pages.

You can have each section start on a new page by turning on chunking. 
(Check the archives of this list for how to do that.) But you don't need
sections on separate pages in order to link directlly to them.  For
example, this link:

http://24.112.178.91/cogent/prepdoc/pd-customizingthedssslstylesheets.html#PD-COGENTBOTHDSLFILE

takes you directly to a sect2 that starts in the middle of a page.  It
happens to be embedded in a sect1 that is in a new page, but it could be
anywhere.  Notice that the #XX corresponds to the tag id shown
below.  The start tag for the element (which happens to be a sect1) that
starts the page is:

sect1 id=pd-customizingthedssslstylesheets

The sect2 start tag is:

sect2 id=pd-cogentbothdslfile

The processor converts the lower case to upper case and puts it after
the .html#.  To get this behavior, you need to set the following
parameter to #t in your stylesheet customization layer:

(define %use-id-as-filename%
  ;; Use ID attributes as name for component HTML files?
  #t)

Hope this helps. 


Cheerio!

Bob

---
Robert McIlvride ([EMAIL PROTECTED])
Cogent Real-Time Systems (www.cogent.ca)

--
To unsubscribe from this elist send a message with the single word
unsubscribe in the body to: [EMAIL PROTECTED]



Re: DOCBOOK-APPS: link from HTML to docbook HTML

2001-08-09 Thread Bob Stayton

 From: klaas holwerda [EMAIL PROTECTED]
 
 I was wondering if there is a way to create links from HTML files to
 docbook generated HTML.
 I experimented with the DSSL style sheet, if i give a id to a section
 or chapter,
 most of the time i get file named like that.
 Which makes it easy to links to them from the outside, and even internal
 anchors do work.
 
 But in case of the first section within a chapter, the first section is
 placed on the same page as the chapter and
 its table of contents, so no seperate file.
 Therefore  next question would be how can i control that (certain)
 sections get placed on seperate pages.
 I tried beginpage, but that not make a difference.
 
 For the XML style sheets the behaviour is different, i get files like
 ch01.html , sect01.html etc.

 So i am wondering if i should forget about the idea, still
 i have a strong need for it :-(.

Don't give up.  There is a definite logic to the XSL
stylesheet output that lets you cross reference to the
HTML.  It works best when each element in the target
document has an id attribute.

If you are seeing ch01.html, etc., then the document you
are cross referencing to was chunked, meaning it was
split into many HTML files.  The breakpoints for chunking
are at the elements named set, book, part, chapter, appendix,
and sect1 (or first-level section equivalent).  And
a few others like index.  There is an XSL parameter
'chunk.sections' which if set to true will further break
up sect1 into more files.

If the element that starts a new chunk has an id attribute,
then that is used as the filename, plus .html. If you
are seeing ch01.html, then that chapter element did not
have an id value to make into a filename, so the XSL
stylesheet had to generate a name.  It does so by counting
chapters in the document. The naming scheme makes sure each
output filename is unique. If your document is a set of
books that each have a chapter 1, then the chunked
filenames use bk01ch01.html (book 1, chapter 1) and bk02ch01.html
(book2, chapter 1), etc.

So the filenames depend on how deeply the original
XML document was structured, and whether it
used id attributes in its chunking elements.

Every element that doesn't start a new chunk can still be
referenced if it has an id attribute, because the
stylesheet inserts a name=id in the HTML output at that
point.  So if you know the ids of the chunk and of your
final destination, you can form an href like
HREF=myfile.html#finalstop.  If the target element
does not have an id, then there won't be an a name=* 
tag in the HTML output, so you can't reference it directly.

Working with filenames that are generated is risky, because
if the document is rearranged the numbering will
change.  That's why I said it works best if
all the elements you want have ids.  

bob
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: [EMAIL PROTECTED]

--
To unsubscribe from this elist send a message with the single word
unsubscribe in the body to: [EMAIL PROTECTED]