EDN Admin
Well-known member
Hi all,
I have an XML document that has a number of NodeSets. Each of these NodeSets has a child node that contains a date value, in the format, yyyymmdd (i.e. 20101207). The format is good as we dont need to do any formatting on it to apply a calculation. However,
I need to extract only a single NodeSet, the NodeSet whose child date node is the highest (i.e. latest date).
Example XML that I have is below..
<TRENDAS><br/>
<DATE>20091231</DATE><br/>
<POENG>29</POENG><br/>
</TRENDAS><br/>
<TRENDAS><br/>
<DATE>20101016</DATE><br/>
</TRENDAS> <br/>
<TRENDAS><br/>
<DATE>20081231</DATE><br/>
<POENG>29</POENG><br/>
</TRENDAS>
The bold NodeSet would be the NodeSet I need in this case as it contains the latest date.
Any help on this would be much appreciated.
Is there XPath that can extract this NodeSet directly, or would sorting need to be applied and then extract the top (position = 1) NodeSet?
Thanks in advance
Tryst <hr class="sig Tryst
View the full article
I have an XML document that has a number of NodeSets. Each of these NodeSets has a child node that contains a date value, in the format, yyyymmdd (i.e. 20101207). The format is good as we dont need to do any formatting on it to apply a calculation. However,
I need to extract only a single NodeSet, the NodeSet whose child date node is the highest (i.e. latest date).
Example XML that I have is below..
<TRENDAS><br/>
<DATE>20091231</DATE><br/>
<POENG>29</POENG><br/>
</TRENDAS><br/>
<TRENDAS><br/>
<DATE>20101016</DATE><br/>
</TRENDAS> <br/>
<TRENDAS><br/>
<DATE>20081231</DATE><br/>
<POENG>29</POENG><br/>
</TRENDAS>
The bold NodeSet would be the NodeSet I need in this case as it contains the latest date.
Any help on this would be much appreciated.
Is there XPath that can extract this NodeSet directly, or would sorting need to be applied and then extract the top (position = 1) NodeSet?
Thanks in advance
Tryst <hr class="sig Tryst
View the full article