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

RE: RE: How to implement an array

Subject: RE: RE: How to implement an array
From: Imrran Wahid <devguy2003@xxxxxxxxx>
Date: Thu, 13 Feb 2003 17:43:09 -0800 (PST)
last name wahid
Wendell,
It's a neat solution. Thanks for the time you took to
help me resolve this along the way. It's been bugging
me for a while. Now I'm off to implement it with
several different tables being defined in the lookup
file.

Once again, thanks to you and all who make this list a
healthy resource for learning.

Imrran

> 
> It's tricky and confusing. In order to get the logic
> right, you actually 
> have to invert it. First iterate over the lookup
> nodes in $Table1Struct, 
> creating a <td> for each one. Then its value: you
> want the value of that 
> child of your Item that passes your name test; if
> there is none, presumably 
> (this being HTML) you want a placeholding
> non-breaking space.
> 
> This template will do this:
> 
> <xsl:template match="Table1/Item" mode="celldata">
>    <xsl:variable name="thisitem" select="."/>
>      <tr>
>        <xsl:for-each select="$Table1Struct">
>          <td>
>            <xsl:value-of
> select="$thisitem/*[name()=name(current())]"/>
>            <!-- selects that child of the Item whose
> name is the name of
>                 the $Table1Struct node we're looking
> at -->
>            <xsl:if
>              
>
test="not($thisitem/*[name()=name(current())])">?</xsl:if>
>            <!-- if there is none, gives us a space
> -->
>          </td>
>        </xsl:for-each>
>    </tr>
> </xsl:template>
> 
> Please ask about anything mysterious here.
> 
> Cheers,
> Wendell
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

 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.