Sorting

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • p0wer

    #1

    Sorting

    Let's suppose I have this sample document:

    <root>
    <entry id="1"
    <date>2003-08-03</date>
    <param_1>5</param_1>
    <param_2>10</param_2>
    </entry>
    <entry id="2">
    ...
    </entry>
    </root>

    Given some template to apply to this data, firstly I want to sort these
    entries according to content of "date" element. Secondly, I would like to
    split the result tree into two parts - the documents which are newer than 30
    days and the rest, and following that I need to sort these groups according
    to value of param_2 and param_1 (in the given order). The code I have tried
    looks like this:

    <xsl:apply-templates select="entry[number( concat(
    substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
    ($date - $new_days)]">
    <xsl:sort select="param_2 " order="descendi ng"/>
    <xsl:sort select="param_1 " order="descendi ng"/>
    <xsl:sort select="date" order="descendi ng"/>
    </xsl:apply-templates>

    But there's some caveat: the data gets sorted by param_2 and if there are
    two entries with equal value, they are not sorted further by param_1. The
    same applies the level below - if there are two entries with equal values of
    param_1, they don't get sorted by date. What's wrong here? How can I make
    this work the way I want it to?

    I use PHP 4.3.2 with DOM XML.


    --

    __ .: Radoslaw Loboda :. | Cool stuff !!!
    (oo) rloboda@bojko.k rakow.pl | --------------------
    / \/ \ | www.tigerhomes.org
    `V__V' | www.suncam.tv



  • Dimitre Novatchev

    #2
    Re: Sorting

    Can you provide a complete (but the smallest possible) example --
    source.xml, your transformation, the result and how it doesn't meet
    your expectations.


    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL


    "p0wer" <p0wer@bojko_kr akow_pl> wrote in message news:<3f5e0f2c$ 1@news.vogel.pl >...[color=blue]
    > Let's suppose I have this sample document:
    >
    > <root>
    > <entry id="1"
    > <date>2003-08-03</date>
    > <param_1>5</param_1>
    > <param_2>10</param_2>
    > </entry>
    > <entry id="2">
    > ...
    > </entry>
    > </root>
    >
    > Given some template to apply to this data, firstly I want to sort these
    > entries according to content of "date" element. Secondly, I would like to
    > split the result tree into two parts - the documents which are newer than 30
    > days and the rest, and following that I need to sort these groups according
    > to value of param_2 and param_1 (in the given order). The code I have tried
    > looks like this:
    >
    > <xsl:apply-templates select="entry[number( concat(
    > substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
    > ($date - $new_days)]">
    > <xsl:sort select="param_2 " order="descendi ng"/>
    > <xsl:sort select="param_1 " order="descendi ng"/>
    > <xsl:sort select="date" order="descendi ng"/>
    > </xsl:apply-templates>
    >
    > But there's some caveat: the data gets sorted by param_2 and if there are
    > two entries with equal value, they are not sorted further by param_1. The
    > same applies the level below - if there are two entries with equal values of
    > param_1, they don't get sorted by date. What's wrong here? How can I make
    > this work the way I want it to?
    >
    > I use PHP 4.3.2 with DOM XML.[/color]

    Comment

    • p0wer

      #3
      Re: Sorting (long)

      > Can you provide a complete (but the smallest possible) example --[color=blue]
      > source.xml, your transformation, the result and how it doesn't meet
      > your expectations.[/color]

      It is a basic link list built with XML:

      <?xml version="1.0" encoding="UTF-8"?>
      <LinkList>
      <Entries>
      <Entry id="1">
      <SomeTags/>
      <Date>2003-08-01</Date>
      <SomeTags/>
      <LinkData>
      <Hits count="10"/>
      <Rates>
      <rate>6</rate>
      <rate>4</rate>
      </Rates>
      <SomeTags/>
      </LinkData>
      </Entry>
      <Entry id="2">
      <SomeTags/>
      <Date>2003-09-10</Date>
      <SomeTags/>
      <LinkData>
      <Hits count="5"/>
      <Rates>
      <rate>9</rate>
      <rate>1</rate>
      </Rates>
      <SomeTags/>
      </LinkData>
      </Entry>
      </Entries>
      <SomeTags/>
      </LinkList>

      What I want is to simply generate a list, where:
      - newest entries (let's say not older than 30 days) are placed on the top of
      the list
      - newest entries and the rest are sorted separately
      - sorting order of each group is Hits-Rate (which is a simple average of all
      rates)
      - each output page displays a defined number of links (passed as param by
      PHP)

      Seems like I can't get it the recursive way because XSLT does not allow to
      reassign variable values. I have managed though to make it sort the entries
      in the top-level approach, that means I have first sorted them according to
      Hits, then Rate and Date coming last. But trying to output all the new
      entries first, and then the rest, still maintaining the order and limiting
      the number of links per page seems too hard for me.

      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:styleshe et version="1.0"
      xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
      <xsl:output method="html" encoding="iso88 59-1" indent="yes"
      standalone="yes "/>

      <!-- Variables used in document -->
      <xsl:param name="style_css "/>
      <xsl:param name="start_id" >0</xsl:param>
      <xsl:param name="end_id">0 </xsl:param>
      <xsl:param name="date"/>
      <xsl:param name="new_days" >30</xsl:param>

      <xsl:template match="/">
      <html>
      <head>
      <link rel="stylesheet " href="{$style_c ss}"/>
      </head>
      <body scroll="auto">
      <table width="100%" height="100%" border="0" cellpadding="3"
      cellspacing="0" >
      <tbody>
      <tr>
      <td height="100%" align="center" valign="top">

      <xsl:call-template name="date_chec k"/>

      </td>
      </tr>
      </tbody>
      </table>
      </body>
      </html>
      </xsl:template>

      <xsl:template name="date_chec k">
      <xsl:param name="new">0</xsl:param>
      <xsl:for-each select="/LinkList/Entries/Entry">
      <xsl:sort select="LinkDat a/Hits/@count" order="descendi ng"/>
      <xsl:sort select="sum(Lin kData/Rates/rate) div count(LinkData/Rates/rate)"
      order="descendi ng"/>
      <xsl:sort select="Date" order="descendi ng"/>
      <xsl:value-of select="positio n()"/>
      <xsl:if test="$end_id = 0 or (position() &gt;= $start_id and position()
      &lt;= $end_id)">
      <xsl:apply-templates select="current ()[number( concat(
      substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &gt;=
      ($date - $new_days)]"/>
      <xsl:apply-templates select="current ()[number( concat(
      substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
      ($date - $new_days)]"/>
      </xsl:if>
      </xsl:for-each>
      </xsl:template>

      <xsl:template match="Entry">
      <xsl:variable name="entry_dat e">
      <xsl:value-of select="number( concat(
      substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) )"/>
      </xsl:variable>

      <!-- This is just simple display - trimmed down -->
      <table width="100%" border="0" cellpadding="0" cellspacing="0"
      style="border:n one">
      <tbody>
      <tr>
      <td align="left" valign="middle" >
      <a>
      <xsl:attribut e name="href">
      <xsl:text>?acti on=view&amp;id= </xsl:text>
      <xsl:value-of select="@id"/>
      </xsl:attribute>
      <xsl:value-of select="Title"/>
      </a>
      <xsl:if test="$entry_da te &gt;= ($date - 30)">
      &#160;<span class="red">NEW !</span>
      </xsl:if>
      </td
      <td align="center" width="80" height="40">
      <div class="red">
      <xsl:value-of select="LinkDat a/Hits/@count"/>
      </div>
      <span class="small">
      <br/>(<xsl:value-of select="Date"/>)
      </span>
      </td>
      <td align="center" width="40">
      <span class="red">

      <xsl:value-of select="format-number( ( sum(LinkData/Rates/rate) ) div
      ( count(LinkData/Rates/rate) ),'0.0')"/>

      </span>
      </td>
      </tr>
      </tbody>
      </table>
      </xsl:template>

      Let's say we have this data:
      - id=1 & id=2 are old entries
      - id=3 & id=4 are new entries
      - id=2 has hits=2
      - id=3 has rate=2
      - 2 links per page
      After sorting the order is 2-3-4-1, which is correct. But right now I get it
      only this way. What I need is 3-4-2-1... The two entries for apply-templates
      were used for some conditional choices, but it didn't work out exactly what
      was expected. The selects are working, but now I need to put them somewhere
      else to group the nodes.


      --

      __ .: Radoslaw Loboda :. | Cool stuff !!!
      (oo) rloboda@bojko.k rakow.pl | --------------------
      / \/ \ | www.tigerhomes.org
      `V__V' | www.suncam.tv



      Comment

      • Dimitre Novatchev

        #4
        Re: Sorting (long)

        Your problem is that you are combining several problems in one and are
        trying to solve them at once.

        This can be solved by addressing each problem individually and then
        combining the solutions. Probably a multi-pass solution will be one of the
        easiest possible.

        However, the problem in your code is not at all the sorting.

        It seems to me that your date arithmetic is not OK.

        In particular:
        [color=blue]
        > <xsl:apply-templates select="current ()[number( concat(
        > substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &gt;=
        > ($date - $new_days)]"/>
        > <xsl:apply-templates select="current ()[number( concat(
        > substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
        > ($date - $new_days)]"/>[/color]


        the above calculation of "new" and "old" links will not work correctly in
        most of the cases.


        So, I would recommend that you try to split the task into sub-problems,
        which are more realistic and manageable and then you have greater chances to
        succeed.

        You may find a dates/time library of templates useful. One such library is
        the datetime_lib.xs l library, which comes with the XSelerator and can be
        downloaded with the trial version of the product.


        =====
        Cheers,

        Dimitre Novatchev.
        http://fxsl.sourceforge.net/ -- the home of FXSL

        "p0wer" <p0wer@bojko_kr akow_pl> wrote in message
        news:3f5ee53c@n ews.vogel.pl...[color=blue][color=green]
        > > Can you provide a complete (but the smallest possible) example --
        > > source.xml, your transformation, the result and how it doesn't meet
        > > your expectations.[/color]
        >
        > It is a basic link list built with XML:
        >
        > <?xml version="1.0" encoding="UTF-8"?>
        > <LinkList>
        > <Entries>
        > <Entry id="1">
        > <SomeTags/>
        > <Date>2003-08-01</Date>
        > <SomeTags/>
        > <LinkData>
        > <Hits count="10"/>
        > <Rates>
        > <rate>6</rate>
        > <rate>4</rate>
        > </Rates>
        > <SomeTags/>
        > </LinkData>
        > </Entry>
        > <Entry id="2">
        > <SomeTags/>
        > <Date>2003-09-10</Date>
        > <SomeTags/>
        > <LinkData>
        > <Hits count="5"/>
        > <Rates>
        > <rate>9</rate>
        > <rate>1</rate>
        > </Rates>
        > <SomeTags/>
        > </LinkData>
        > </Entry>
        > </Entries>
        > <SomeTags/>
        > </LinkList>
        >
        > What I want is to simply generate a list, where:
        > - newest entries (let's say not older than 30 days) are placed on the top[/color]
        of[color=blue]
        > the list
        > - newest entries and the rest are sorted separately
        > - sorting order of each group is Hits-Rate (which is a simple average of[/color]
        all[color=blue]
        > rates)
        > - each output page displays a defined number of links (passed as param by
        > PHP)
        >
        > Seems like I can't get it the recursive way because XSLT does not allow to
        > reassign variable values. I have managed though to make it sort the[/color]
        entries[color=blue]
        > in the top-level approach, that means I have first sorted them according[/color]
        to[color=blue]
        > Hits, then Rate and Date coming last. But trying to output all the new
        > entries first, and then the rest, still maintaining the order and limiting
        > the number of links per page seems too hard for me.
        >
        > <?xml version="1.0" encoding="UTF-8"?>
        > <xsl:styleshe et version="1.0"
        > xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
        > <xsl:output method="html" encoding="iso88 59-1" indent="yes"
        > standalone="yes "/>
        >
        > <!-- Variables used in document -->
        > <xsl:param name="style_css "/>
        > <xsl:param name="start_id" >0</xsl:param>
        > <xsl:param name="end_id">0 </xsl:param>
        > <xsl:param name="date"/>
        > <xsl:param name="new_days" >30</xsl:param>
        >
        > <xsl:template match="/">
        > <html>
        > <head>
        > <link rel="stylesheet " href="{$style_c ss}"/>
        > </head>
        > <body scroll="auto">
        > <table width="100%" height="100%" border="0" cellpadding="3"
        > cellspacing="0" >
        > <tbody>
        > <tr>
        > <td height="100%" align="center" valign="top">
        >
        > <xsl:call-template name="date_chec k"/>
        >
        > </td>
        > </tr>
        > </tbody>
        > </table>
        > </body>
        > </html>
        > </xsl:template>
        >
        > <xsl:template name="date_chec k">
        > <xsl:param name="new">0</xsl:param>
        > <xsl:for-each select="/LinkList/Entries/Entry">
        > <xsl:sort select="LinkDat a/Hits/@count" order="descendi ng"/>
        > <xsl:sort select="sum(Lin kData/Rates/rate) div[/color]
        count(LinkData/Rates/rate)"[color=blue]
        > order="descendi ng"/>
        > <xsl:sort select="Date" order="descendi ng"/>
        > <xsl:value-of select="positio n()"/>
        > <xsl:if test="$end_id = 0 or (position() &gt;= $start_id and position()
        > &lt;= $end_id)">
        > <xsl:apply-templates select="current ()[number( concat(
        > substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &gt;=
        > ($date - $new_days)]"/>
        > <xsl:apply-templates select="current ()[number( concat(
        > substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
        > ($date - $new_days)]"/>
        > </xsl:if>
        > </xsl:for-each>
        > </xsl:template>
        >
        > <xsl:template match="Entry">
        > <xsl:variable name="entry_dat e">
        > <xsl:value-of select="number( concat(
        > substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) )"/>
        > </xsl:variable>
        >
        > <!-- This is just simple display - trimmed down -->
        > <table width="100%" border="0" cellpadding="0" cellspacing="0"
        > style="border:n one">
        > <tbody>
        > <tr>
        > <td align="left" valign="middle" >
        > <a>
        > <xsl:attribut e name="href">
        > <xsl:text>?acti on=view&amp;id= </xsl:text>
        > <xsl:value-of select="@id"/>
        > </xsl:attribute>
        > <xsl:value-of select="Title"/>
        > </a>
        > <xsl:if test="$entry_da te &gt;= ($date - 30)">
        > &#160;<span class="red">NEW !</span>
        > </xsl:if>
        > </td
        > <td align="center" width="80" height="40">
        > <div class="red">
        > <xsl:value-of select="LinkDat a/Hits/@count"/>
        > </div>
        > <span class="small">
        > <br/>(<xsl:value-of select="Date"/>)
        > </span>
        > </td>
        > <td align="center" width="40">
        > <span class="red">
        >
        > <xsl:value-of select="format-number( ( sum(LinkData/Rates/rate) ) div
        > ( count(LinkData/Rates/rate) ),'0.0')"/>
        >
        > </span>
        > </td>
        > </tr>
        > </tbody>
        > </table>
        > </xsl:template>
        >
        > Let's say we have this data:
        > - id=1 & id=2 are old entries
        > - id=3 & id=4 are new entries
        > - id=2 has hits=2
        > - id=3 has rate=2
        > - 2 links per page
        > After sorting the order is 2-3-4-1, which is correct. But right now I get[/color]
        it[color=blue]
        > only this way. What I need is 3-4-2-1... The two entries for[/color]
        apply-templates[color=blue]
        > were used for some conditional choices, but it didn't work out exactly[/color]
        what[color=blue]
        > was expected. The selects are working, but now I need to put them[/color]
        somewhere[color=blue]
        > else to group the nodes.
        >
        >
        > --
        >
        > __ .: Radoslaw Loboda :. | Cool stuff !!!
        > (oo) rloboda@bojko.k rakow.pl | --------------------
        > / \/ \ | www.tigerhomes.org
        > `V__V' | www.suncam.tv
        >
        >
        >[/color]


        Comment

        • p0wer

          #5
          Re: Sorting (long)

          U¿ytkownik "Dimitre Novatchev" <dnovatchev@yah oo.com> napisa³ w wiadomo¶ci
          news:bjnln1$l4s v6$1@ID-152440.news.uni-berlin.de...[color=blue]
          > Your problem is that you are combining several problems in one and are
          > trying to solve them at once.
          >
          > This can be solved by addressing each problem individually and then
          > combining the solutions. Probably a multi-pass solution will be one of the
          > easiest possible.[/color]

          And trying to do multi-pass in one XSLT document? Interesting, have some
          good/advanced examples?
          [color=blue]
          > However, the problem in your code is not at all the sorting.
          >
          > It seems to me that your date arithmetic is not OK.
          >
          > In particular:
          >[color=green]
          > > <xsl:apply-templates select="current ()[number( concat(
          > > substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &gt;=
          > > ($date - $new_days)]"/>
          > > <xsl:apply-templates select="current ()[number( concat(
          > > substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
          > > ($date - $new_days)]"/>[/color]
          >
          >
          > the above calculation of "new" and "old" links will not work correctly in
          > most of the cases.[/color]

          I said it works OK. I know that when I want one month back I have to pass
          100 as new_days. I suppose you thought that a bit better would be supplying
          a timestamp and playing with it. Anyway, the select staatements could be
          used in some other place, but still trying to make up where will they fit...
          [color=blue]
          > So, I would recommend that you try to split the task into sub-problems,
          > which are more realistic and manageable and then you have greater chances[/color]
          to[color=blue]
          > succeed.[/color]

          The version which I have supplied is indeed a mix of all the separate stuff.
          [color=blue]
          > You may find a dates/time library of templates useful. One such library is
          > the datetime_lib.xs l library, which comes with the XSelerator and can be
          > downloaded with the trial version of the product.[/color]

          I might try installing some extensions, but what if I move it to the server
          which does not support them? Admins are unlikely to do it for one user and
          this site is made for other person. Instead, I am trying to get it work
          without any extensions...


          --

          __ .: Radoslaw Loboda :. | Cool stuff !!!
          (oo) rloboda@bojko.k rakow.pl | --------------------
          / \/ \ | www.tigerhomes.org
          `V__V' | www.suncam.tv



          Comment

          • Dimitre Novatchev

            #6
            Re: Sorting (long)

            > > It seems to me that your date arithmetic is not OK.[color=blue][color=green]
            > >
            > > In particular:
            > >[color=darkred]
            > > > <xsl:apply-templates select="current ()[number( concat(
            > > > substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &gt;=
            > > > ($date - $new_days)]"/>
            > > > <xsl:apply-templates select="current ()[number( concat(
            > > > substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
            > > > ($date - $new_days)]"/>[/color]
            > >
            > >
            > > the above calculation of "new" and "old" links will not work correctly[/color][/color]
            in[color=blue][color=green]
            > > most of the cases.[/color]
            >
            > I said it works OK. I know that when I want one month back I have to pass
            > 100 as new_days. I suppose you thought that a bit better would be[/color]
            supplying[color=blue]
            > a timestamp and playing with it. Anyway, the select staatements could be
            > used in some other place, but still trying to make up where will they[/color]
            fit...

            But one month can be 28, 29, 30 or 31 days...

            What about going from December to January?
            [color=blue][color=green]
            > > You may find a dates/time library of templates useful. One such library[/color][/color]
            is[color=blue][color=green]
            > > the datetime_lib.xs l library, which comes with the XSelerator and can be
            > > downloaded with the trial version of the product.[/color]
            >
            > I might try installing some extensions, but what if I move it to the[/color]
            server[color=blue]
            > which does not support them? Admins are unlikely to do it for one user and
            > this site is made for other person. Instead, I am trying to get it work
            > without any extensions...[/color]

            What I recommended is not extensions -- it is pure XSLT 1.0 and you don't
            have to install anything -- just copy this .xsl file in your folder.



            =====
            Cheers,

            Dimitre Novatchev.
            http://fxsl.sourceforge.net/ -- the home of FXSL



            Comment

            • p0wer

              #7
              Re: Sorting (long)

              U¿ytkownik "Dimitre Novatchev" <dnovatchev@yah oo.com> napisa³ w wiadomo¶ci
              news:bjo1lm$l33 k6$1@ID-152440.news.uni-berlin.de...[color=blue]
              > But one month can be 28, 29, 30 or 31 days...
              >
              > What about going from December to January?[/color]

              The year also changes :) Didn't notice? Stripping slashes gives a number
              like 20030911.
              [color=blue]
              > What I recommended is not extensions -- it is pure XSLT 1.0 and you don't
              > have to install anything -- just copy this .xsl file in your folder.[/color]

              I will give it a try tommorow, although current version of PHP DOMXML
              (4.3.2rc3) is said to be having problems with including XSLT's inside other
              XSLT's ("The method can not perform an XSLT transformation, where an XSL
              uses imported XSL")


              --

              __ .: Radoslaw Loboda :. | Cool stuff !!!
              (oo) rloboda@bojko.k rakow.pl | --------------------
              / \/ \ | www.tigerhomes.org
              `V__V' | www.suncam.tv



              Comment

              • Dimitre Novatchev

                #8
                Re: Sorting (long)


                "p0wer" <p0wer@bojko_kr akow_pl> wrote in message
                news:3f5f9257$1 @news.vogel.pl. ..[color=blue]
                > U¿ytkownik "Dimitre Novatchev" <dnovatchev@yah oo.com> napisa³ w wiadomo¶ci
                > news:bjo1lm$l33 k6$1@ID-152440.news.uni-berlin.de...[color=green]
                > > But one month can be 28, 29, 30 or 31 days...
                > >
                > > What about going from December to January?[/color]
                >
                > The year also changes :) Didn't notice? Stripping slashes gives a number
                > like 20030911.[/color]

                Yes, I know this. But how do you add 15 days to 20021217 ?

                =====
                Cheers,

                Dimitre Novatchev.
                http://fxsl.sourceforge.net/ -- the home of FXSL


                Comment

                • p0wer

                  #9
                  Re: Sorting (long)

                  U¿ytkownik "Dimitre Novatchev" <dnovatchev@yah oo.com> napisa³ w wiadomo¶ci
                  news:bjouvt$l6f 6n$1@ID-152440.news.uni-berlin.de...[color=blue]
                  > "p0wer" <p0wer@bojko_kr akow_pl> wrote in message[color=green]
                  > > The year also changes :) Didn't notice? Stripping slashes gives a number
                  > > like 20030911.[/color]
                  >
                  > Yes, I know this. But how do you add 15 days to 20021217 ?[/color]

                  The functions you are talking about are quite nice. In fact I was thinking
                  exactly the same - julian date can be also calculated as integer part of
                  (timestamp/86400) (I think so...). I wonder how could I use these functions
                  for every date in each entry... Define a variable inside foreach? Please
                  help me with this algorithm...


                  --

                  __ .: Radoslaw Loboda :. | Cool stuff !!!
                  (oo) rloboda@bojko.k rakow.pl | --------------------
                  / \/ \ | www.tigerhomes.org
                  `V__V' | www.suncam.tv



                  Comment

                  • Dimitre Novatchev

                    #10
                    Re: Sorting (long)


                    "p0wer" <p0wer@bojko_kr akow_pl> wrote in message
                    news:3f648efc$1 @news.vogel.pl. ..[color=blue]
                    > U¿ytkownik "Dimitre Novatchev" <dnovatchev@yah oo.com> napisa³ w wiadomo¶ci
                    > news:bjouvt$l6f 6n$1@ID-152440.news.uni-berlin.de...[color=green]
                    > > "p0wer" <p0wer@bojko_kr akow_pl> wrote in message[color=darkred]
                    > > > The year also changes :) Didn't notice? Stripping slashes gives a[/color][/color][/color]
                    number[color=blue][color=green][color=darkred]
                    > > > like 20030911.[/color]
                    > >
                    > > Yes, I know this. But how do you add 15 days to 20021217 ?[/color]
                    >
                    > The functions you are talking about are quite nice. In fact I was thinking
                    > exactly the same - julian date can be also calculated as integer part of
                    > (timestamp/86400) (I think so...). I wonder how could I use these[/color]
                    functions[color=blue]
                    > for every date in each entry... Define a variable inside foreach? Please
                    > help me with this algorithm...[/color]


                    See the code of my Calendar Application, available at:

                    http://www.topxml.com/code/default.a...20020711152545

                    This XSLT app displays the quarters, months, weeks, calendar and weekdays of
                    the current year. Today's date and any date from the Holidays.xml file are
                    highlighted. Placing the cursor over a specific holiday produces a tip,
                    describing this event. You can customize it by editing the Holidays.xml file
                    and specifying your own holidays/events data there.


                    =====
                    Cheers,

                    Dimitre Novatchev.
                    http://fxsl.sourceforge.net/ -- the home of FXSL


                    Comment

                    Working...