[Home] [By Thread] [By Date] [Recent Entries]
Forgive me if this posted already. One of the core concepts of XSTL is context. In your case, the for-each instruction sets the context to the Assignment elements. For <xsl:value-of select="Assignment"> to work, an Assignment element would have to have an Assignment element as a child. What you need to do is select the current context, thus: <xsl:value-of select="."> Also, I bet your overall design would benefit from applying templates at each level rather than using for-each to reach past an intermediate level of elements. For people coming from a procedural language, for-each seems like a for loop and feels comfortable. Unfortunately, that's a dangerous mis-perception that usually leads to some really hard-to-solve issues. So, I suggest you get in the habit of doing things the XSLT way and use templates as your first choice and for-each when you must. To do the same thing with templates, by the way, you'd have two templates, thus: <xsl:template match="Assignments"> <xsl:apply-templates/> </xsl:template> <xsl:template match="Assignment"> <tr> <td><xsl:value-of select="@DateDue"/></td> <td><xsl:value-of select="@DateAssigned"/></td> <td><xsl:value-of select="."/></td> </tr> </xsl:template> HTH Oh, and welcome to XSLT. Jay Bryant Bryant Communication Services
|

Cart



