Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Checking preceding siblings in a foreach group

From: "Anthony Jones" <Ant@------------.--->
To: 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
>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent