xsl-list
[Top] [All Lists]

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

2004-05-14 07:31:36
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.

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>
--+--





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