EDN Admin
Well-known member
Xsl for grouping<br/>
Hi guys i have a xml from an error log.<br/>
it is:<br/>
<br/>
<pre class="prettyprint <events>
<error>
<date>23/01/2013 14:40:29</date><text>error description text</text>
</error>
<error>
<date>23/01/2013 14:40:28</date><text>error description text</text>
</error>
<error>
<date>22/01/2013 14:40:27</date><text>error description text</text>
</error>
<error>
<date>22/01/2013 14:40:26</date><text>error description text</text>
</error>
<error>
<date>21/01/2013 21:30:36</date><text>error description text</text>
</error>
<error>
<date>21/01/2013 21:26:54</date><text>error description text</text>
</error>
<error>
<date>20/01/2013 21:26:54</date><text>error description text</text>
</error>
<error>
<date>20/01/2013 21:26:53</date><text>error description text</text>
</error>
</events>[/code]
I want a XSL to group by day, make an output like this<br/>
<br/>
Day 20/01/2013<br/>
hour value - error text<br/>
hour value- error text<br/>
hour value- error text<br/>
<br/>
Day 21/01/2013<br/>
hour value- error text<br/>
hour value- error text<br/>
hour value- error text<br/>
<br/>
Day 22/01/2013<br/>
hour value - error text<br/>
hour value- error text<br/>
hour value - error text<br/>
<br/>
of course sorting by date<br/>
i know that must to use for-each-group, then read the<br/>
http://www.w3.org/TR/xslt-30/#element-for-each-group<br/>
but i a newbie and don really understand it.
greetings
View the full article
Hi guys i have a xml from an error log.<br/>
it is:<br/>
<br/>
<pre class="prettyprint <events>
<error>
<date>23/01/2013 14:40:29</date><text>error description text</text>
</error>
<error>
<date>23/01/2013 14:40:28</date><text>error description text</text>
</error>
<error>
<date>22/01/2013 14:40:27</date><text>error description text</text>
</error>
<error>
<date>22/01/2013 14:40:26</date><text>error description text</text>
</error>
<error>
<date>21/01/2013 21:30:36</date><text>error description text</text>
</error>
<error>
<date>21/01/2013 21:26:54</date><text>error description text</text>
</error>
<error>
<date>20/01/2013 21:26:54</date><text>error description text</text>
</error>
<error>
<date>20/01/2013 21:26:53</date><text>error description text</text>
</error>
</events>[/code]
I want a XSL to group by day, make an output like this<br/>
<br/>
Day 20/01/2013<br/>
hour value - error text<br/>
hour value- error text<br/>
hour value- error text<br/>
<br/>
Day 21/01/2013<br/>
hour value- error text<br/>
hour value- error text<br/>
hour value- error text<br/>
<br/>
Day 22/01/2013<br/>
hour value - error text<br/>
hour value- error text<br/>
hour value - error text<br/>
<br/>
of course sorting by date<br/>
i know that must to use for-each-group, then read the<br/>
http://www.w3.org/TR/xslt-30/#element-for-each-group<br/>
but i a newbie and don really understand it.
greetings
View the full article