So I've got a SharePoint list of items, some of which have a Comment and all of which are associated with a Step.
The Step field is essentially a lookup on another table's column which incorporates the sort value followed by the step name.
I need to pull only the valid Comment associated with the highest sort value embedded in the Step
Problem is that the comments are not always present, and the steps are not always in the same order as the IDs, so position() is out.
My last attempt with a xsl:sort is in the CODE section below. The substring-before(substring
-after( part filters out empty comments (<div></div>)
<xsl:for-each select="$Dates[substring-before(substring-after(@Comment,'>'),'<') !='']">
<xsl:sort select=. data-type="text" order=descending/>