Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Checking preceding siblings in a foreach group [Thread Next] Re: Checking preceding siblings in a foreach groupTo: NULL Date: 4/6/2007 1:23:00 PM substring(lduk_vp_date,1,10) != substring(preceding-sibling::*[1]/lduk_vp_date, 1, 10) However you should note that the preceding-sibiling:: axis applies to the order of the nodes in the document. Hence this only works if the all transactions for a specified day are adjacent to each other. That being the case your xsl:sort is probably redundant. "IanK" <iankiddcroftamie@y...> wrote in message news:1175764392.551602.275300@y...... > I am trying to produce output like this: > > 01/01/2007 Something for january 1st > Something else for january 1st > And another for january 1st > 05/01/2007 A data row for january 5th > And another for january 5th > > And I'm using code like this: > <xsl:for-each select="transactions/transdet"> > <xsl:sort select="lduk_vp_date"/> > <tr valign="top"> > <td align="left"> > <xsl:if test="lduk_vp_date != preceding-sibling::*[1]/ > lduk_vp_date"> > <xsl:call-template name="shortdate"> > <xsl:with-param name="datetime"> > <xsl:value-of select="lduk_vp_date"/> > </xsl:with-param> > </xsl:call-template> > </xsl:if> > </td> > etc. > > This is KIND OF working, but I've realised that my date field > (lduk_vp_date) contains a time component too, but I'm not interested > in the time. My output is therefore looking like this: > 01/01/2007 00:01:15 Something for january 1st > 01/01/2007 06:23:05 Something else for january 1st > 01/01/2007 07:01:11 And another for january 1st > 05/01/2007 06:45:22 A data row for january 5th > 05/01/2007 06:45:25 And another for january 5th > > Is there anything I can do to avoid this? I'm restricted to XSL > Version1 unfortunately. > > Thanks > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
