List Info

Thread: multiple templates for a single tag?




multiple templates for a single tag?
user name
2006-06-19 23:06:27
Hi Bob, Oh. boy. I sure hope you can follow this email. I'm
chunking my xml.
I traced the calls to make.toc for the book element, and
I'm finding several
templates for "book" that have no mode
distinctions.

one is in chunk_code.xsl that calls process-chunk-element
one is in division.xsl that calls the titlepage and
make.lots, make.tocs
one in chunk_code.xsl and docbook.xsl called "/"
which should catch book -
right?
one in docbook.xsl called "*" which is also
"catches" the book - right?

It seems to me division.xsl SHOULD be called, cause it's
the last one. But
chunk_code's template is clearly called when chunking.

And it seems to me that the only template that calls
make.toc is the one
found in divisions.xsl, and that chunk_code's template does
not. 

So, it seems that chuck-code's template is called, then
division's template
is called then docbook's templates are called. Am I on the
right track? or
am I missing some fundamental XSL knowledge?

If all of them have to be called, how do I write a
customization for
multiple templates of the same name? I get an
"ambiguous template name"
error. Do I need several customization xsl files?

Thanks!

LN



-----Original Message-----
From: Webmaster 
Sent: Monday, June 19, 2006 4:28 PM
To: docbook-apps
Subject: RE: [docbook-apps] customizing docbook and
generating toc for
new custom tag


Thank you, Perfect! That's what I needed!

I'm also trying to get the "next"
"prev" thing to work too. Any clues into
that?  Thanks to all who work on docbook - it's awesome! 


LN

-----Original Message-----
From: Bob Stayton [mailto:bobssagehill.net]
Sent: Monday, June 19, 2006 4:12 PM
To: Webmaster; docbook-apps
Subject: Re: [docbook-apps] customizing docbook and
generating toc for
new custom tag


Hi,
Take a look in html/autotoc.xsl.  A toc for HTML is created
by calling the 
'make.toc' template with a parameter names 'nodes' that
selects what 
elements to include at the next level of toc.  You will need
to customize 
the select statement to include your new element names.

And then you will need to create a new match template for
each element in 
mode="toc" that handles that element.  Since
your elements are parallel to 
existing elements, you should be able to trace through how
book, chapter, 
and section are handled to add your new element names.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobssagehill.net


----- Original Message ----- 
From: "Webmaster" <Webmastercomtrol.com>
To: "docbook-apps" <docbook-appslists.oasis-open.org>
Sent: Monday, June 19, 2006 1:47 PM
Subject: RE: [docbook-apps] customizing docbook and
generating toc for new 
custom tag


>I was hoping someone could help me with this. I'm
trying to figure out how
> to generate a TOC for a new custom tag that I've
added.
>
> Thanks!
>
> Lauralyn
>
> -----Original Message-----
> From: Webmaster
> Sent: Tuesday, May 23, 2006 6:20 PM
> To: docbook-apps
> Subject: [docbook-apps] customizing docbook and
generating toc
>
>
> Hi.
>
> I'm really excited that I've gotten so far on my own
as to doing this, 
> but
> I'm really stuck on one thing.
>
> This is what I've done so far: I have created and am
using my own 
> elements
> (productcatalog, product, versions) in place of
docbooks elements (book,
> chapter,section respectively):
>
> <productcatalog> (root element of the xml)
> <product id=skuofproduct>
> <title></title>
> <version></version>
> </product>
> </productcatalog>
>
>
> I'm able to use the chucking algorithm of docbook
successfully to chunk 
> at
> the product level. Each page is appropriately named
after the ID of the
> product (which happens to be the sku)
>
> The one difficulty I'm still having is:
>
> 1) How can I generate a TOC of these new
"sections"? Currently my 
> index.html
> page comes up empty. is there a parameter ? I already
have:
>
> <xsl:param name="generate.toc">
> product  toc,title
> </xsl:param>
>
> am I missing a template of some sort of mode or
something?
>
>
> If you can just point me to the stylesheets/templates I
need to modify 
> that
> would be great. I'm at a lost.
>
> Thank you!!!
>
> LN
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: docbook-apps-helplists.oasis-open.org
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
> For additional commands, e-mail: docbook-apps-helplists.oasis-open.org
>
>
> 


------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org

------------------------------------------------------------
---------
To unsubscribe, e-mail: docbook-apps-unsubscribelists.oasis-open.org
For additional commands, e-mail: docbook-apps-helplists.oasis-open.org

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )