This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
I have an xml of the form <data> <row> <col>2003-05-04</col> </row> <row> <col>2003-05-07</col> </row> <row> <col>2003-05-04</col> </row> <row> <col>2003-05-08</col> </row> <row> <col>2004-06-08</col> </row> <row> <col>2004-07-08</col> </row> . . . </data> The col element has dates in the form of yyyy-mm-dd. I am trying to find distinct yyyy-mm values from the above XML in a "variable". I can get distinct date values by using <xsl:variable name="distinctdate" select="//row[not(col=preceding-sibling::row/col)]/col"></xsl:variable> which gives me 2003-05-04 2003-05-07 2003-05-08 2004-06-08 2004-07-08
but what i'd really like is 2003-05 2004-06 2004-07 Any reponses will be greatly appreciated. Thanx
Fudge this rule with the substring function: substring(col, 0, 7) so that you are comparing the first seven chars and not the value of the col element in its entirety. You will have to do some trial and error.
I am leaving the homework for you.
Joined: Oct 29, 2004
Madhav, Thanx for the suggestion but i can't get the substring'd value. This is what I changed the rule to