[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: math get maximum and subtract 1

Subject: Re: math get maximum and subtract 1
From: "sascha" <sascha@xxxxxxxxxx>
Date: Mon, 29 Jul 2002 14:23:10 +0200
value of thanksgiving math
----- Original Message -----
From: "Jeni Tennison" <jeni@xxxxxxxxxxxxxxxx>
Subject: Re:  math get maximum and subtract 1


> Note that this only works because your DESCRIPTION_ITEMs are sorted by
> column and then by row. If they're sorted in some other way, or aren't
> actually sorted at all, then we need to try another method.


Jeni,

remember that topic? Well, actually that IS what we have right now...
Our client has changed it's export and the description_items aren't sorted
at all.
Unfortunately i do not have an example at the moment. But I am wondering if
there is any way at all to solve this then...
I hope that i will get a real example tomorrow.

Here's the sorted example again:


<DESCRIPTION_TABLE>
   <DESCRIPTION_ITEM col="0" row="0">
    <LABEL>Verantwortlicher</LABEL>
    <VALUE>Text</VALUE>
   </DESCRIPTION_ITEM>
   <DESCRIPTION_ITEM col="0" row="1">
    <LABEL>Prozessziel</LABEL>
    <VALUE>Text</VALUE>
   </DESCRIPTION_ITEM>
   <DESCRIPTION_ITEM col="0" row="2">
    <LABEL>Messgrösse</LABEL>
    <VALUE>Text</VALUE>
   </DESCRIPTION_ITEM>
   <DESCRIPTION_ITEM col="0" row="3">
    <LABEL>Benötigte Informationen</LABEL>
    <VALUE>Text</VALUE>
   </DESCRIPTION_ITEM>
   <DESCRIPTION_ITEM col="0" row="4">
    <LABEL>Erzeugte Ergebnisse</LABEL>
    <VALUE>Text</VALUE>
   </DESCRIPTION_ITEM>
   <DESCRIPTION_ITEM col="1" row="0">
    <LABEL>Externe Vorschriften</LABEL>
    <VALUE>Text</VALUE>
   </DESCRIPTION_ITEM>
   <DESCRIPTION_ITEM col="1" row="1">
    <LABEL>Hinweise</LABEL>
    <VALUE>Text</VALUE>
   </DESCRIPTION_ITEM>
   <DESCRIPTION_ITEM col="1" row="2">
    <LABEL>Potenzial</LABEL>
    <VALUE>Text</VALUE>
   </DESCRIPTION_ITEM>
   <DESCRIPTION_ITEM col="1" row="3">
    <LABEL>Mitgeltende Unterlagen</LABEL>
    <VALUE>Text</VALUE>
   </DESCRIPTION_ITEM>
   <DESCRIPTION_ITEM col="1" row="4">
    <LABEL>Offene Fragen</LABEL>
    <VALUE>Text</VALUE>
   </DESCRIPTION_ITEM>
  </DESCRIPTION_TABLE>

and the working template:

<xsl:template match="DESCRIPTION_TABLE">

<xsl:variable name="nrows" select="DESCRIPTION_ITEM[last()]/@row + 1" />
<xsl:variable name="ncols" select="DESCRIPTION_ITEM[last()]/@col + 1" />


  <fo:table table-layout="fixed" width="100%">

    <xsl:for-each select="DESCRIPTION_ITEM[@row = 0]">
    <fo:table-column column-width="proportional-column-width(1)" />
  </xsl:for-each>


    <fo:table-body font-size="8pt">


   <xsl:for-each select="DESCRIPTION_ITEM[@col = 0]">
    <fo:table-row>
      <xsl:for-each select="../DESCRIPTION_ITEM [(position() - 1) mod $nrows
= current()/@row]">

        <fo:table-cell>
         <fo:block>
  <xsl:call-template name="desc_items"><xsl:with-param name="item"
select="."/></xsl:call-template>
          </fo:block>
        </fo:table-cell>
      </xsl:for-each>
    </fo:table-row>
  </xsl:for-each>

    </fo:table-body>
  </fo:table>
</xsl:template>


any idea, already?

sascha




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.