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

Empty nodes and xsl:for-each select

  • From: Newsha Makooi <Newsha@i...>
  • To: xml-dev@l...
  • Date: Tue, 15 Aug 2000 16:15:11 -0600

xsl for each select
Title: Empty nodes and xsl:for-each select

Dear XMLers,

I am writing in regards to the output table on page 523 of Michael Kay's XSLT, Programmer's Reference. 

In the example XML document, the score value is an attribute of the element.  Let's just say that instead of using attributes to hold the score value we used a <Score>2</Score> element for each <Team>Brazil</Team>

Now, let's say that some of these <Score>2</Score> elements were empty, as in <Score></Score>.  How would you go about building a table, creating an empty cell for your output table based on an empty <Score></Score> value?


I have

<xsl:for-each select="Team/Score" order-by="+ Name">
        <td>
                <xsl:value-of select="."/>
        </td>
</xsl:for-each>

and this causes the table cells not to match up with the table headings, because of the selection part.  You see, the empty <Score></Score> elements are not even selected.  This is a problem since the values are not displayed accurately.

Any <suggestions/>?  Please advise.

Regards,
Newsha


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.