You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Baeckham <ba...@gmx.net> on 2007/05/24 14:05:20 UTC
list in list - list with sublist
Hi,
I want to convert a xml containing this structure (xhtml) into a pdf:
<ul>
<li>asa</li>
<li>sasa</li>
<li>sasa</li>
<ul>
<li>sadasdsad</li>
<li>sasasd324324a</li>
<li>sa2343242342sa</li>
</ul>
<li>asa</li>
<li>sasa</li>
<li>sasa</li>
</ul>
It should look like this, after transformation:
* asa
* sasa
* sasa
* sadasdsad
* sasasd324324a
* sa2343242342sa
* asa
* sasa
* sasa
My "solution" looks like this, it works for a simple list, but not for list in
a list.
<xsl:template match="ul">
<fo:list-block start-indent="5mm" end-indent="10mm"
provisional-distance-between-starts="5mm">
<xsl:apply-templates/>
</fo:list-block>
</xsl:template>
<xsl:template match="li">
<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:value-of select="."/>
</fo:block>
<xsl:apply-templates/>
</fo:list-item-body>
</fo:list-item>
</xsl:template>
Does any knows how to do this?
Steffen
[OT]Re: list in list - list with sublist
Posted by David Delbecq <de...@oma.be>.
BTW, according to (x)html dtds, ul is not correct content inside ul :)
you should surround your inner list by a <li></li>, like this:
<ul>
<li>asa</li>
<li>sasa</li>
<li>sasa</li>
<li>
<ul>
<li>sadasdsad</li>
<li>sasasd324324a</li>
<li>sa2343242342sa</li>
</ul>
</li>
<li>asa</li>
<li>sasa</li>
<li>sasa</li>
</ul>
En l'instant précis du 24/05/07 14:05, Baeckham s'exprimait en ces termes:
> Hi,
>
> I want to convert a xml containing this structure (xhtml) into a pdf:
> <ul>
> <li>asa</li>
> <li>sasa</li>
> <li>sasa</li>
> <ul>
> <li>sadasdsad</li>
> <li>sasasd324324a</li>
> <li>sa2343242342sa</li>
> </ul>
> <li>asa</li>
> <li>sasa</li>
> <li>sasa</li>
> </ul>
>
> It should look like this, after transformation:
> * asa
> * sasa
> * sasa
> * sadasdsad
> * sasasd324324a
> * sa2343242342sa
> * asa
> * sasa
> * sasa
>
> My "solution" looks like this, it works for a simple list, but not for list in
> a list.
>
> <xsl:template match="ul">
> <fo:list-block start-indent="5mm" end-indent="10mm"
> provisional-distance-between-starts="5mm">
> <xsl:apply-templates/>
> </fo:list-block>
> </xsl:template>
>
> <xsl:template match="li">
> <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:value-of select="."/>
> </fo:block>
> <xsl:apply-templates/>
> </fo:list-item-body>
> </fo:list-item>
> </xsl:template>
>
> Does any knows how to do this?
>
> Steffen
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: list in list - list with sublist
Posted by Abel Braaksma <ab...@xs4all.nl>.
Hi Steffen,
This is a general transformation question which is best asked on the
xsl-list http://www.mulberrytech.com/xsl/xsl-list/. This list is about
Apache FOP specific questions.
In short: you should create a modified copy template (which will keep
your structure) and go from there. But try that other list for better
assistance.
Cheers,
-- Abel Braaksma
Baeckham wrote:
> Hi,
>
> I want to convert a xml containing this structure (xhtml) into a pdf:
> <ul>
> <li>asa</li>
> <li>sasa</li>
> <li>sasa</li>
> <ul>
> <li>sadasdsad</li>
> <li>sasasd324324a</li>
> <li>sa2343242342sa</li>
> </ul>
> <li>asa</li>
> <li>sasa</li>
> <li>sasa</li>
> </ul>
>
> It should look like this, after transformation:
> * asa
> * sasa
> * sasa
> * sadasdsad
> * sasasd324324a
> * sa2343242342sa
> * asa
> * sasa
> * sasa
>
> My "solution" looks like this, it works for a simple list, but not for list in
> a list.
>
> <xsl:template match="ul">
> <fo:list-block start-indent="5mm" end-indent="10mm"
> provisional-distance-between-starts="5mm">
> <xsl:apply-templates/>
> </fo:list-block>
> </xsl:template>
>
> <xsl:template match="li">
> <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:value-of select="."/>
> </fo:block>
> <xsl:apply-templates/>
> </fo:list-item-body>
> </fo:list-item>
> </xsl:template>
>
> Does any knows how to do this?
>
> Steffen
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org