[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: Fri, 14 Feb 2003 07:34:06 -0800 (PST)
imrran
Wendell,
The template you suggested seemed to have a flaw.

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

When no row in the table contains any element for a
particular column that column is excluded from the
colum heading. But the above template would insert a
blank cell in the table. So we get
Heading: Col1 Col2 Col3
Data     XXX   YYY      ZZZ
Data     XXX   YYY      ZZZ

instead of:
Heading: Col1 Col2 Col3
Data     XXX   YYY ZZZ
Data     XXX   YYY ZZZ

I think it is necessary to check if elements exist for
all children nodes before inserting a cell data (<td>
element). That was the logic I was struggling with.

Imrran

__________________________________________________
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.