|
Subject: Re: [xsl] Inlining blocks in FO From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Sat, 07 Mar 2009 10:17:02 -0500 |
I am trying to produce a PDF document formatted like:
Adobovs, Kivdul
Letters to the editor. Nov/Dec 2001 p.27 .
Philatelic news and views. Sep/Oct 2001 p.35; Sep/Oct 2002 p.11; Nov/Dec 2002 p.28; Jan/Feb 2003 p.24 .
My template file gives me:
Adobovs, Kivdul Letters to the editor. Nov/Dec 2001 p.27 . Philatelic news and views. Sep/Oct 2001 p.35 ; Sep/Oct 2002 p.11 ; Nov/Dec 2002 p.28 ; Jan/Feb 2003 p.24 .
Can someone help me understand how to get the citation elements from articles with the same <Title> all on the same line? I think I need to process the entire node-set for "Philatelic news and views" simultaneously, but am not sure how to write that template.
My XSLT and XML files, much abbreviated but still functional, follow.
<!--take a look at all articles in the item-->
<xsl:template match="Item">
<!--first get the heading out of the way-->
<xsl:apply-templates select="Heading"/>
<!--now group the articles-->
<xsl:for-each-group select="Article" group-by="Title">
<!--and put all citations in one block-->
<fo:block>
<!--for a given title-->
<xsl:apply-templates select="Title"/>
<xsl:text>: </xsl:text>
<!--and for each citation-->
<xsl:apply-templates select="current-group()"/>
</fo:block>
</xsl:for-each-group>
</xsl:template> <!--format the item's heading-->
<xsl:template match="Heading">
<fo:block>
<xsl:apply-templates/>
</fo:block>
</xsl:template> <!--format a citation-->
<xsl:template match="Article">
<xsl:value-of select="IssueName,Year"/>
<xsl:text/> p.<xsl:value-of select=" Page"/>
<xsl:choose>
<xsl:when test="position()=last()">.</xsl:when>
<xsl:otherwise>; </xsl:otherwise>
</xsl:choose>
</xsl:template>
-- XQuery/XSLT training in Prague, CZ 2009-03 http://www.xmlprague.cz XQuery/XSLT/XSL-FO training in Los Angeles/Anaheim - 2009-06-01/10 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Inlining blocks in FO, Mark Wilson | Thread | Re: [xsl] Inlining blocks in FO, Mark Wilson |
| [xsl] Inlining blocks in FO, Mark Wilson | Date | Re: [xsl] Inlining blocks in FO, Mark Wilson |
| Month |