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

RE: XSL selection question

Subject: RE: XSL selection question
From: jeremyf@xxxxxxxxxxx
Date: Wed, 6 Nov 2002 09:14:51 -0500
xsl selection
Sorry,
      The e-mail width did not do the output justice. Let's try that a
different way.

output as this,

<part-number> <Desc.> <View>  <Note Title> <Note Desc>
                      <View>  <Note Title> <Note Desc>

The first 2 cells in the second table row are empty, but their
corresponding tags must be output. This is due to the relationship between
the view -> note title -> note description to the part number ->
description. There may also be instances where I have multiple note/note
desc pairs or multiple note descriptions for a note title for a specific
view. I also need to be able to handle these, but I am having difficulty
finding and information on this. Performing these actions in XSL to HTML
transformation is relatively easy, but I have, as yet, had difficulty
getting the same logic to work in XSL-FO.

A push in the right direction is appreciated though.

thanks,
Jeremy

---Andrew Welch wrote:
>Hi,

>You need to just apply-templates in document order, so in english you
>might say

>for each <inst-part>
>  output <part-number>
>  output <description>
>  output <inst-notes>

>at the moment you are saying

>for each <inst-note>
>  output <part-number>
>  output <description>
>  output content...

>so naturally enough you will get the <part-number> and <description>
>output every time you encounter an <inst-note>.

>Rearrange your templates a little and then apply them in document order
>(if your dtd allows)

>(untested)

><xsl:template match="inst-part">
>  <!-- format the part number and description -->
>  <!-- It is not that easy with FO -->
>  <xsl:apply-templates/>
></xsl:template>

><xsl:template match="part-number">
>  <fo:table-row line-height="10pt">
>    <fo:table-cell padding="4pt">
>      <fo:block text-align="start">
>        <xsl:value-of select="."/>
>      </fo:block>
>    </fo:table-cell>
>  <fo:table-cell padding="4pt" height="1cm">
></xsl:template>

><xsl:template match="description">
>  <fo:table-cell padding="4pt" height="1cm">
>    <fo:block text-align="start">
>      <xsl:value-of select="."/>
>    </fo:block>
>  </fo:table-cell>
></xsl:template>


><xsl:template match="inst-note">
>      <!-- format the output of the "view" value along -->
>      <!-- with the note contents. This will not start -->
>      <!-- at the beginning of the line.               -->
>
>      <!--....part-number and description handling code separated out-->


>      <fo:table-cell padding="4pt" height="1cm">
>        <fo:block text-align="center">
>         <xsl:value-of select="view"/>
>      .....

>cheers
>andrew





 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.