Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: How to convert table from column to row order?

From: "LJB" <.>
To: NULL
Date: 8/16/2006 7:55:00 AM


"Neil Smith [MVP Digital Media]" <neil@n...> wrote in message 
news:hlk1e2lpapv02sh763pr0f6nrco8g3f35j@4......
> On Mon, 14 Aug 2006 10:22:09 -0500, "LJB" <.> wrote:
>
>>I've discovered answers to both my questions. Its amazing what a weekend
>>away from the office can do!
>
> If only we knew what those answers were, others would benefit from
> your moment of clarity !
>
> Cheers - Neil
> ------------------------------------------------
> Digital Media MVP : 2004-2006
> http://mvp.support.microsoft.com/mvpfaqs

My XSL ended up looking like the following. I ended up using call-templates 
with parameters. Perhaps there is a better way.

------------------xsl------------------
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

 <TABLE>
  <xsl:for-each select="//Drawing[position() mod 4 = 1]">
   <TR>
    <xsl:call-template name="TableCell">
     <xsl:with-param name="Detail"
      select="."/>
    </xsl:call-template>

    <xsl:call-template name="TableCell">
     <xsl:with-param name="Detail"
      select="following-sibling::Drawing[1]"/>
    </xsl:call-template>

    <xsl:call-template name="TableCell">
     <xsl:with-param name="Detail"
      select="following-sibling::Drawing[2]"/>
    </xsl:call-template>

    <xsl:call-template name="TableCell">
     <xsl:with-param name="Detail"
      select="following-sibling::Drawing[3]"/>
    </xsl:call-template>
   </TR>
  </xsl:for-each>
 </TABLE>
</xsl:template>

<xsl:template name="TableCell">
 <xsl:param name="Detail"/>
 <TD>
  <xsl:choose>
   <xsl:when test="$Detail">
    <xsl:value-of select="$Detail/Number"/> - <xsl:value-of 
select="$Detail/Title"/>
   </xsl:when>
   <xsl:otherwise>
    &#160;
   </xsl:otherwise>
  </xsl:choose>
 </TD>
</xsl:template>

</xsl:stylesheet>





transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent