OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Empty nodes and xsl:for-each select

[ Lists Home | Date Index | Thread Index ]
  • From: Newsha Makooi <Newsha@imrgold.com>
  • To: xml-dev@lists.xml.org
  • Date: Tue, 15 Aug 2000 16:15:11 -0600

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





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS