Subject: Re: [xsl] XSL-FO list with sublist From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 14 Dec 2007 13:01:35 -0500 |
At the top, generate a list each goal becomes a list item it contains a header test (in a block) if it contains questions, it gets a list (a list-block) each question becomes a list item it contains a header text (in a block) if it contains metrics, it gets a list (a list-block) each metric becomes a list item it contains its text
<xsl:template match="/"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> ... </fo:layout-master-set>
<fo:page-sequence master-reference="simple"> <fo:flow flow-name="xsl-region-body"> <fo:block> ... </fo:block>
<xsl:call-template name="listBlock"/> <!-- dropping the list into the flow here -->
</fo:flow> </fo:page-sequence> </fo:root> </xsl:template>
<xsl:template name="listBlock"> <fo:list-block> <xsl:apply-templates select="gqmroot/goal"/> <!-- each goal gets its own list item --> </fo:list-block> </xsl:template>
<xsl:template match="goal"> <!-- each goal gets its own list item --> <fo:list-item> <fo:list-item-label> <fo:block/> </fo:list-item-label> <fo:list-item-body> <!-- inside the body, first our header text --> <fo:block> <xsl:value-of select="@titleGoal"/> </fo:block> <!-- after the header text, we may need a list for our questions --> <xsl:if test="question"> <fo:list-block> <xsl:apply-templates select="question"/> <!-- each question gets its own list item --> </fo:list-block> </xsl:if> </fo:list-item-body> </fo:list-item> </xsl:template>
<xsl:template match="question"> <!-- similarly, each question gets its own list item --> <fo:list-item> <fo:list-item-label> <fo:block/> </fo:list-item-label> <fo:list-item-body> <!-- inside the body, first our header text --> <fo:block> <xsl:value-of select="@titleQuestion"/> </fo:block> <!-- after the header text, we may need a list for our metrics --> <xsl:if test="metric"> <fo:list-block> <xsl:apply-templates select="metric"/> <!-- each metric gets its own list item --> </fo:list-block> </xsl:if> </fo:list-item-body> </fo:list-item> </xsl:template>
<xsl:template match="metric"> <!-- similarly, each metric gets its own list-item --> <fo:list-item> <fo:list-item-label> <fo:block/> </fo:list-item-label> <fo:list-item-body> <fo:block> <xsl:value-of select="@titleMetric"/> <xsl:value-of select="unparsed-text(@ChartLink)" disable-output-escaping="yes"/> </fo:block> </fo:list-item-body> </fo:list-item> </xsl:template>
I hope this helps, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSL-FO list with sublist, Lucas Gonçalves Gros | Thread | Re: [xsl] XSL-FO list with sublist, Lucas Gonçalves Gros |
Re: [xsl] String hashing code, James A. Robinson | Date | Re: [xsl] XSL-FO and unparsed-text(, Wendell Piez |
Month |