Attached is a xsl try using it, I think it will be of some
help.
Thanks & Regards,
Anshuman
-----Original Message-----
From: Amita Rathore [mailto:[EMAIL PROTECTED]
Sent: Monday, July 26, 2004 6:41 PM
To: [EMAIL PROTECTED]
Subject: Bulleted list
What code can I use in xsl-fo to get a bullet similat to one generated by <li><ul> in html ?
<xsl:template match="html">
<xsl:apply-templates select="body"/>
</xsl:template>
<xsl:template match="a">
<xsl:choose>
<xsl:when test="@name">
<xsl:if test="not(name(following-sibling::*[1]) = 'h1')">
<fo:block line-height="0pt" space-after="0pt"
font-size="0pt" id="[EMAIL PROTECTED]"/>
</xsl:if>
</xsl:when>
<xsl:when test="@href">
<fo:basic-link color="blue">
<xsl:choose>
<xsl:when test="starts-with(@href, '#')">
<xsl:attribute name="internal-destination">
<xsl:value-of select="substring(@href, 2)"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="external-destination">
<xsl:value-of select="@href"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="*|text()"/>
</fo:basic-link>
<xsl:if test="starts-with(@href, '#')">
<xsl:text> on page </xsl:text>
<fo:page-number-citation ref-id="{substring(@href, 2)}"/>
</xsl:if>
</xsl:when>
</xsl:choose>
</xsl:template>
<xsl:template match="address">
<fo:block font-style="italic" space-after="12pt">
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="b">
<fo:inline font-weight="bold">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="big">
<fo:inline font-size="120%">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="blockquote">
<fo:block>
<xsl:attribute name="space-after">
<xsl:choose>
<xsl:when test="ancestor::blockquote ">
<xsl:text>0pt</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>10pt</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="start-indent">
<xsl:variable name="ancestors">
<xsl:choose>
<xsl:when test="count(ancestor::blockquote)">
<xsl:value-of select="1 +
count(ancestor::blockquote) *
1.25"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($ancestors, 'cm')"/>
</xsl:attribute>
<xsl:apply-templates select="*"/>
</fo:block>
<!--fo:block start-indent="1.5cm" end-indent="1.5cm"
space-after="12pt">
<xsl:apply-templates select="*|text()"/>
</fo:block-->
</xsl:template>
<xsl:template match="body">
<xsl:apply-templates select="/html/head/title"/>
<xsl:apply-templates select="*|text()"/>
</xsl:template>
<xsl:template match="br">
<fo:block line-height="5pt" text-align="start" color="#FFFFFF">
<fo:leader leader-pattern="space" leader-length="1mm" />
</fo:block>
<!--fo:block line-height="5pt"> </fo:block-->
</xsl:template>
<xsl:template match="center">
<fo:block text-align="center">
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="cite">
<xsl:choose>
<xsl:when test="parent::i">
<fo:inline font-style="normal">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:when>
<xsl:otherwise>
<fo:inline font-style="italic">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="code">
<fo:inline font-family="monospace">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="dl">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="dt">
<fo:block font-weight="bold" space-after="2pt"
keep-with-next="always">
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="dd">
<fo:block start-indent="1cm">
<xsl:attribute name="space-after">
<xsl:choose>
<xsl:when test="name(following::*[1]) = 'dd'">
<xsl:text>3pt</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>12pt</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="em">
<fo:inline font-style="italic">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="font">
<xsl:variable name="color">
<xsl:choose>
<xsl:when test="@color">
<xsl:value-of select="@color"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>black</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="face">
<xsl:choose>
<xsl:when test="@face">
<xsl:value-of select="@face"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>sans-serif</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="size">
<xsl:choose>
<xsl:when test="@size">
<xsl:choose>
<xsl:when test="contains(@size, 'pt')">
<xsl:text>@size</xsl:text>
</xsl:when>
<xsl:when test="@size = '+1'">
<xsl:text>110%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+2'">
<xsl:text>120%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+3'">
<xsl:text>130%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+4'">
<xsl:text>140%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+5'">
<xsl:text>150%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+6'">
<xsl:text>175%</xsl:text>
</xsl:when>
<xsl:when test="@size = '+7'">
<xsl:text>200%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-1'">
<xsl:text>90%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-2'">
<xsl:text>80%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-3'">
<xsl:text>70%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-4'">
<xsl:text>60%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-5'">
<xsl:text>50%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-6'">
<xsl:text>40%</xsl:text>
</xsl:when>
<xsl:when test="@size = '-7'">
<xsl:text>30%</xsl:text>
</xsl:when>
<xsl:when test="@size = '1'">
<xsl:text>8pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '2'">
<xsl:text>10pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '3'">
<xsl:text>12pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '4'">
<xsl:text>14pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '5'">
<xsl:text>18pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '6'">
<xsl:text>24pt</xsl:text>
</xsl:when>
<xsl:when test="@size = '7'">
<xsl:text>36pt</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>10pt</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:text>13pt</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<fo:inline font-size="{$size}" font-family="{$face}"
space-before="{$size}" color="{$color}">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="h1">
<!--fo:block break-before="page">
<fo:leader leader-pattern="rule"/>
</fo:block-->
<fo:block font-size="28pt" line-height="32pt"
keep-with-next="always"
space-after="22pt" font-family="serif">
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:when test="name(preceding-sibling::*[1]) = 'a' and
preceding-sibling::[EMAIL PROTECTED]">
<xsl:value-of select="preceding-sibling::*[1]/@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="text-align">
<xsl:choose>
<xsl:when test="@align">
<xsl:if test="@align = 'left'">
<xsl:text>start</xsl:text>
</xsl:if>
<xsl:if test="@align = 'center'">
<xsl:text>center</xsl:text>
</xsl:if>
<xsl:if test="@align = 'right'">
<xsl:text>end</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text>start</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="h2">
<fo:block font-size="24pt" line-height="28pt"
keep-with-next="always" space-after="18pt"
font-family="serif">
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="text-align">
<xsl:choose>
<xsl:when test="@align">
<xsl:if test="@align = 'left'">
<xsl:text>start</xsl:text>
</xsl:if>
<xsl:if test="@align = 'center'">
<xsl:text>center</xsl:text>
</xsl:if>
<xsl:if test="@align = 'right'">
<xsl:text>end</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text>start</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="h3">
<fo:block font-size="21pt" line-height="24pt"
keep-with-next="always" space-after="14pt"
font-family="serif">
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="text-align">
<xsl:choose>
<xsl:when test="@align">
<xsl:if test="@align = 'left'">
<xsl:text>start</xsl:text>
</xsl:if>
<xsl:if test="@align = 'center'">
<xsl:text>center</xsl:text>
</xsl:if>
<xsl:if test="@align = 'right'">
<xsl:text>end</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text>start</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="h4">
<fo:block font-size="18pt" line-height="21pt"
keep-with-next="always" space-after="12pt"
font-family="serif">
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="text-align">
<xsl:choose>
<xsl:when test="@align">
<xsl:if test="@align = 'left'">
<xsl:text>start</xsl:text>
</xsl:if>
<xsl:if test="@align = 'center'">
<xsl:text>center</xsl:text>
</xsl:if>
<xsl:if test="@align = 'right'">
<xsl:text>end</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text>start</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="h5">
<fo:block font-size="16pt" line-height="19pt"
keep-with-next="always" space-after="12pt"
font-family="serif">
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="text-align">
<xsl:choose>
<xsl:when test="@align">
<xsl:if test="@align = 'left'">
<xsl:text>start</xsl:text>
</xsl:if>
<xsl:if test="@align = 'center'">
<xsl:text>center</xsl:text>
</xsl:if>
<xsl:if test="@align = 'right'">
<xsl:text>end</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text>start</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="h6">
<fo:block font-size="14pt" line-height="17pt"
keep-with-next="always" space-after="12pt"
font-family="serif">
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="@id">
<xsl:value-of select="@id"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="generate-id()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="text-align">
<xsl:choose>
<xsl:when test="@align">
<xsl:if test="@align = 'left'">
<xsl:text>start</xsl:text>
</xsl:if>
<xsl:if test="@align = 'center'">
<xsl:text>center</xsl:text>
</xsl:if>
<xsl:if test="@align = 'right'">
<xsl:text>end</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text>start</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="hr">
<fo:block>
<fo:leader leader-pattern="rule"/>
</fo:block>
</xsl:template>
<xsl:template match="i">
<fo:inline font-style="italic">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="kbd">
<fo:inline font-family="monospace" font-size="110%">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="nobr">
<fo:inline wrap-option="no-wrap">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="ol">
<fo:list-block provisional-distance-between-starts="1cm"
provisional-label-separation="0.5cm">
<xsl:attribute name="space-after">
<xsl:choose>
<xsl:when test="ancestor::ul or ancestor::ol">
<xsl:text>0pt</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>10pt</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="start-indent">
<xsl:variable name="ancestors">
<xsl:choose>
<xsl:when test="count(ancestor::ol) or count(ancestor::ul) or count(ancestor::blockquote)">
<xsl:value-of select="1 +
(count(ancestor::ol) +
count(ancestor::blockquote) +
count(ancestor::ul)) *
1.25"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($ancestors, 'cm')"/>
</xsl:attribute>
<xsl:apply-templates select="*"/>
</fo:list-block>
</xsl:template>
<xsl:template match="ol/li">
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>
<xsl:variable name="value-attr">
<xsl:choose>
<xsl:when test="../@start">
<xsl:number value="position() + ../@start - 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:number value="position()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="../@type='i'">
<xsl:number value="$value-attr" format="i. "/>
</xsl:when>
<xsl:when test="../@type='I'">
<xsl:number value="$value-attr" format="I. "/>
</xsl:when>
<xsl:when test="../@type='a'">
<xsl:number value="$value-attr" format="a. "/>
</xsl:when>
<xsl:when test="../@type='A'">
<xsl:number value="$value-attr" format="A. "/>
</xsl:when>
<xsl:otherwise>
<xsl:number value="$value-attr" format="1. "/>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
<xsl:template match="p">
<xsl:if test="[EMAIL PROTECTED]'7']">
<fo:block line-height="24pt">
<fo:leader leader-pattern="space" leader-length="90mm" />
</fo:block>
</xsl:if>
<xsl:if test="[EMAIL PROTECTED]'6']">
<fo:block line-height="18pt">
<fo:leader leader-pattern="space" leader-length="90mm" />
</fo:block>
</xsl:if>
<fo:block font-size="9pt" line-height="13pt"
space-after="10pt">
<xsl:attribute name="text-align">
<xsl:choose>
<xsl:when test="@align">
<xsl:if test="@align = 'left'">
<xsl:text>start</xsl:text>
</xsl:if>
<xsl:if test="@align = 'center'">
<xsl:text>center</xsl:text>
</xsl:if>
<xsl:if test="@align = 'right'">
<xsl:text>end</xsl:text>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:text>start</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="pre">
<fo:block font-family="monospace"
white-space-collapse="false" wrap-option="no-wrap">
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="samp">
<fo:inline font-family="monospace" font-size="110%">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="small">
<fo:inline font-size="80%">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="strike">
<fo:inline text-decoration="line-through">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="strong">
<fo:inline font-weight="bold">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="sub">
<fo:inline vertical-align="sub" font-size="75%">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="sup">
<fo:inline vertical-align="super" font-size="75%">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="title">
<fo:block>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</xsl:template>
<xsl:template match="u">
<fo:inline text-decoration="underline">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
<xsl:template match="ul">
<fo:list-block provisional-distance-between-starts="1cm"
provisional-label-separation="0.5cm">
<xsl:attribute name="space-after">
<xsl:choose>
<xsl:when test="ancestor::ul or ancestor::ol">
<xsl:text>0pt</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>10pt</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="start-indent">
<xsl:variable name="ancestors">
<xsl:choose>
<xsl:when test="count(ancestor::ol) or count(ancestor::ul) or count(ancestor::blockquote)">
<xsl:value-of select="1 +
(count(ancestor::ol) +
count(ancestor::blockquote) +
count(ancestor::ul)) *
1.25"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>1</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($ancestors, 'cm')"/>
</xsl:attribute>
<xsl:apply-templates select="*"/>
</fo:list-block>
</xsl:template>
<!-- ============================================
List items inside unordered lists are easy; we
just have to use the correct Unicode character
for the bullet.
=============================================== -->
<xsl:template match="ul/li">
<!--fo:list-item>
<fo:list-item-label end-indent="label-end()">
<xsl:choose>
<xsl:when test="UL">
<fo:block></fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block>•</fo:block>
</xsl:otherwise>
</xsl:choose>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</fo:list-item-body>
</fo:list-item-->
<fo:list-item>
<fo:list-item-label end-indent="label-end()">
<fo:block>•</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
<xsl:apply-templates select="*|text()"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
<!-- ============================================
The <var> element is rendered in italics.
=============================================== -->
<xsl:template match="var">
<fo:inline font-style="italic">
<xsl:apply-templates select="*|text()"/>
</fo:inline>
</xsl:template>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
