xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Trezise" <brian.trez...@intellidata.net>
Subject RE: Auto-generate table of contents
Date Tue, 18 Aug 2009 15:25:17 GMT
Thanks Sergiu, I got it to work :)

~Brian

-----------------------------
Brian Trezise
IntelliData, Inc.
Staff Software Engineer
brian.trezise@intellidata.net
t: 720.524.4864
m: 303.809.9782

-----Original Message-----
From: Sergiu Dumitriu [mailto:sergiu@xwiki.com] 
Sent: Saturday, August 15, 2009 4:11
To: fop-users@xmlgraphics.apache.org
Subject: Re: Auto-generate table of contents

Brian Trezise wrote:
> Can somebody point me to a good (and well explained) example of using 
> XSL/FOP to auto-create a table of contents? I've spent the last couple 
> hours looking for information on this but it's not making sense.
> 
>  
> 
> Here's a sample of my xml:
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <catalog>
> 
>   <intellispec>
> 
>     <pn>C0805C101J1GACTU</pn>
> 
>     <aliases>
> 
>       <alias>C0805C101J1GAC7800</alias>
> 
>     </aliases>
> 
>     <mfg>KEMET</mfg>
> 
>     <svg-path>C:/svn/code/IntelliSpec/images/</svg-path>
> 
>     <copyright-year>2006-2009</copyright-year>
> 
>       . . .
> 
>   </intellispec>
> 
>   <intellispec>
> 
>     <pn>T491B107K010AT</pn>
> 
>     <mfg>KEMET</mfg>
> 
>     <svg-path>C:/svn/code/IntelliSpec/images/</svg-path>
> 
>     <copyright-year>2006-2009</copyright-year>
> 
>       . . .
> 
>   </intellispec>
> 
>       . . .
> 
>  
> 
> I would like to generate a table of contents page using the text of the 
> catalog/intellispec/pn and mfg tags (the table of contents would render 
> more or less as follows:
> 
> C0805C101J1GACTU (KEMET) ..................... 1
> 
> T491B107K010AT (KEMET) ....................... 2
> 
>       . . .
> 
> (Each item would also have an internal hyperlink to the page number in 
> the pdf where the associated datasheet is located)

Perhaps this can help as an example: 
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-core/src/main/r
esources/xhtml2fo.xsl

Look for <!-- Table of content --> to find the code that generates the 
table of contents, and then search for
<xsl:template match="html:h1" mode="transform">
to see how to generate the link target.


-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message