xsl-list
[Top] [All Lists]

RE: [xsl] Generating Index pages

2006-08-04 01:54:06
Hi,

I am producing PDF via XSL-FO.
The output for Index is like

A 

AC adaptor 1-4
        Connecting 3-6

B

Battery
        Charging 1-6
        Indicator  2-6
        real time clock 3-1

Battery pack 1-3

But with the current xslfo code I am getting outpuit as.....

<fo:block id="d0e37466" axf:outline-level="1" axf:outline-expand="false"
margin-left="-2cm" font-family="Arial Black" font-size="20pt"
font-weight="bold" color="#A53A3A" space-after="15pt" margin-bottom="15pt"
keep-with-next="always" axf:outline-title="Appendix J -
Index">Index</fo:block>
        
<fo:inline id="">AC adaptor</fo:inline>
<fo:inline id="">AC adaptor connecting</fo:inline>
<fo:inline id="">Battery pack</fo:inline>
<fo:inline id="">Battery pack</fo:inline>
<fo:inline id="">Battery pack additional</fo:inline>
<fo:inline id="">Battery charging</fo:inline>
<fo:inline id="">Battery indicator</fo:inline>
<fo:inline id="">Battery real time clock</fo:inline>

Below is the part of xslfo code.....

<xsl:template match="indexterm[not(parent::indexterm)]">
        <!--    <fo:inline id="{(_at_)id}"
color="#FF6347"><xsl:apply-templates/></fo:inline>-->
        <fo:inline id="{(_at_)id}">
                <xsl:apply-templates/> 
        </fo:inline>
</xsl:template>

<xsl:template name="index.psu">
        <fo:block id="idx" xsl:use-attribute-sets="body"
axf:outline-level="1" axf:outline-expand="false"
axf:outline-title="{$index.var}">
                <xsl:call-template name="generate-index"/>
        </fo:block>
</xsl:template>

<!-- **** collect all index-entries as node-sets, copied according to
index-element content model ****-->
<xsl:variable name="index.tmp">
        <xsl:apply-templates select="//indexterm[not(ancestor::indexterm)]"
mode="copy">
                <xsl:sort/>
        </xsl:apply-templates>
</xsl:variable>

<xsl:template match="indexterm[not(parent::indexterm)]" mode="copy">
        <indexterm ref="{(_at_)id}">
                <xsl:attribute name="div">
                        <xsl:number count="division[not(@type)] |
division[(_at_)type='chapter']" level="any"/>
                </xsl:attribute>
                <primary>
                        <xsl:copy-of select="text()"/>
                </primary>
                <xsl:apply-templates select="indexterm" mode="copy"/>
        </indexterm>
</xsl:template>

<xsl:template match="indexterm/indexterm" mode="copy">
        <secondary>
                <xsl:apply-templates/>
        </secondary>
</xsl:template>


--
Shailesh

-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com] 
Sent: Friday, August 04, 2006 1:28 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Generating Index pages

You need to give some indication of the output you are trying to produce.

How are you producing the PDF? Via XSL-FO, or some other way? It's useful to
show the output you want in XML terms, so that the problem is a pure XSLT
problem.

It's also useful to explain where you are hitting problems. Show your
attempt to solve the problem, even if it doesn't work: it gives us a good
clue as to what you know already and what you still need to learn. 

Michael Kay
http://www.saxonica.com/



-----Original Message-----
From: Shailesh Shinde [mailto:shailesh(_at_)quagnito(_dot_)com] 
Sent: 04 August 2006 08:31
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Generating Index pages

Hi All,

I have a requirement to generate index pages in pdf....
Below is the Inputxml which contains indexes like......
<division>
 <topic id="d0e37466">
        <title>Index</title>
<body>
<indexterm ref="d0e1155" div="1">
<primary>AC adaptor</primary>
</indexterm>
<indexterm ref="d0e5920" div="3">
<primary>AC adaptor</primary>
<secondary>connecting</secondary>
</indexterm>
<indexterm ref="d0e1073" div="1">
<primary>Battery pack</primary>
</indexterm>
<indexterm ref="d0e4522" div="2">
<primary>Battery pack</primary>
</indexterm>
<indexterm ref="d0e17995" div="8">
<primary>Battery pack</primary>
<secondary>additional</secondary>
</indexterm>
<indexterm ref="d0e13611" div="6">
<primary>Battery</primary>
<secondary>charging</secondary>
</indexterm>
<indexterm ref="d0e4986" div="2">
<primary>Battery</primary>
<secondary>indicator</secondary>
</indexterm>
<indexterm ref="d0e13314" div="6">
<primary>Battery</primary>
<secondary>real time clock</secondary>
</indexterm>
<indexterm ref="d0e13391" div="6">
<primary>Battery</primary>
<secondary>safety precautions</secondary> </indexterm> 
<indexterm ref="d0e11747" div="5"> <primary>Battery</primary> 
<secondary>types</secondary> </indexterm> <indexterm 
ref="d0e23008" div="9"> <primary>Bluetooth</primary> 
<secondary>problems</secondary> </indexterm> <indexterm 
ref="d0e23084" div="9"> <primary>Bluetooth</primary> 
<secondary>problems</secondary> </indexterm>
      </body>
      </topic>
   </division> 

Can you please provide ant references or examples for the same.

Thanks,
Shailesh



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>