I have some XML which I would like to transform into a report showing counts on the number of nodes matching a specific criteria within a date period.
Example xml below. I am trying to show a count of nodes based on Status within a date range.
I can match based on date range but I am having trouble showing the status count within that range. Any pointers appreciated.
<?xml version="1.0" encoding="UTF-8"?>
<List>
<Item>
<Value name="Status">Open</Value>
<Value name="Date">2012-09-01</Value>
<Value name="Name">Item 1</Value>
</Item>
<Item>
<Value name="Status">Open</Value>
<Value name="Date">2012-10-15</Value>
<Value name="Name">Item 2</Value>
</Item>
<Item>
<Value name="Status">Open</Value>
<Value name="Date">2012-10-15</Value>
<Value name="Name">Item 3</Value>
</Item>
<Item>
<Value name="Status">Pending</Value>
<Value name="Date">2012-10-20</Value>
<Value name="Name">Item 4</Value>
</Item>
<Item>
<Value name="Status">Closed</Value>
<Value name="Date">2012-10-30</Value>
<Value name="Name">Item 5</Value>
</Item>
</List>
Example output would be:-
Status 2012-10-01 - 2012-10-31
Open 2
Closed 1
Pending 1
As simple as this:
When this transformation is applied on the provided XML document:
the wanted, correct result is produced: