xsl-list
[Top] [All Lists]

RE: [xsl fo] xsl to a minimum / statements 'on the fly'

2004-05-14 08:09:48


You can achieve what you want with attribute value templates

<elem attr="{expr}">

but it seems to me like a peculiar design. It seems to miss the whole point
of what stylesheets are for.

yes I know it looks strange (i'm still exploring this design/strategy).

My rationale behind this strategy:

I want to put most in xml so I only need 1 xsl file per output medium (e.g. pdf, html) but per output medium only 1 xsl file is able to generate x different 'reports'.

disadvantage: For different reportstyles of same data I need different xml files.

This is acceptable because in my app, xml generation/manipulation is relatively easy to accomplish and I don't want my user to introduce to xsl.

I still have to see if this works out.
--

<elem attr="{expr}">  ??

I don't get it yet but I'll investigate this answer further. (I'm not a regular xsl user)

thanks,

Mathieu


Michael Kay

> -----Original Message-----
> From: ongeaddresseerd ongeaddresseerd
> [mailto:ongeadresseerd(_at_)hotmail(_dot_)com]
> Sent: 14 May 2004 12:48
> To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
> Subject: [xsl] [xsl fo] xsl to a minimum / statements 'on the fly'
>
> (expecting my first mail didn't reach the list, apologizing
> if this is the
> second mail with the same question)
>
> Hi all,
>
> I'm rendering pdf's with fop and I would like to keep all my
> lines/files of
> xsl to a minimum.
>
> This means I put a lot of formatting information in my xml
> file, something
> like this:
>
> <reportXML page-layout="portrait">
>    <title> Hello world </title>
>    <table table-layout="fixed">
>            <tr background-color="#CCCCCC">
>                    <td width="10cm"
>                       <block align="left">hello again</block>
>                    </td>
>            </tr>
>                   ...
>
> Trying to keep xsl to a minimum also means it won't include
> hard-coded lines
> like:
>
>   <fo:page-sequence master-reference="portrait">
>
> My fo-statements (try to) use elements from the input xml,
> something like
> this:
>
>   <fo:page-sequence master-reference="<xsl:value-of
> select="$page_layout"/>">
>
> As expectd, his statement won't work.
>
> How to accomplisch this?
>
> ps what (technically) works, is:
>
>    <xsl:if test="@page-layout='portrait'">
>            <fo:page-sequence master-reference="portrait">
>                    <xsl:call-template
> name="continue"></xsl:call-template>
>            </fo:page-sequence>
>    </xsl:if>
>
>    <xsl:if test="@page-layout='landscape'">
>            <fo:page-sequence master-reference="landscape">
>                    <xsl:call-template
> name="continue"></xsl:call-template>
>            </fo:page-sequence>
>    </xsl:if>
>
> But this will overload my xsl file with if-statements (difficult to
> maintain)
> because I have to use this mechanism a lot.
>
> Thanks in advance,
>
> mathieu van echtelt
>
> _________________________________________________________________
> Hotmail en Messenger on the move
> http://www.msn.nl/communicatie/smsdiensten/hotmailsmsv2/
>
>
> --+------------------------------------------------------------------
> 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>
--+--


_________________________________________________________________
MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl



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