I have reduced the script to eliminate possible typos. The data is showing with no grouping, but as soon as i put the grouping back in.. I get blank data. This code does (not) produce grouping, but for the life of me.. i cant see why
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<
xsl:output
method
=
"xml"
indent
=
"yes"
omit-xml-declaration
=
"yes"
/>
<!--
This prefix is used to generate module specific query strings
Each querystring or form value that starts with udt_{ModuleId}_param
will be added as parameter starting with param
-->
<
xsl:variable
name
=
"prefix_param"
>udt_<
xsl:value-of
select
=
"//udt:Context/udt:ModuleId"
/>_param</
xsl:variable
>
<
xsl:param
name
=
"param_orderby"
select
=
"//udt:Fields[udt:UserDefinedFieldId=//udt:Context/udt:OrderBy]/udt:SortColumn"
/>
<
xsl:param
name
=
"param_direction"
select
=
"//udt:Context/udt:OrderDirection"
/>
<!--wrong string would break stylesheet, so fallback to ascending if userinput is wrong-->
<
xsl:variable
name
=
"orderDirection"
>
<
xsl:choose
>
<
xsl:when
test
=
"$param_direction='descending'"
>
<
xsl:text
>descending</
xsl:text
>
</
xsl:when
>
<
xsl:otherwise
>
<
xsl:text
>ascending</
xsl:text
>
</
xsl:otherwise
>
</
xsl:choose
>
</
xsl:variable
>
<
xsl:variable
name
=
"orderType"
>
<
xsl:variable
name
=
"DataType"
select
=
"//udt:Fields[udt:SortColumn=$param_orderby]/udt:FieldType"
/>
<
xsl:choose
>
<
xsl:when
test
=
"$DataType='Int32' or $DataType='Decimal' or $DataType='Currency'"
>number</
xsl:when
>
<
xsl:otherwise
>text</
xsl:otherwise
>
</
xsl:choose
>
</
xsl:variable
>
<
xsl:key
name
=
"Min_Area"
match
=
"udt:Data"
use
=
"udt:Ministry_Area"
/>
<
xsl:template
match
=
"udt:Data"
mode
=
"list"
>
<
xsl:for-each
select
=
"udt:Data[count(. | key('Min_Area', udt:Ministry_Area)[1]) = 1]"
>
<
tr
>
<
td
>
<
xsl:value-of
select
=
"udt:Ministry_Area"
disable-output-escaping
=
"yes"
/>
</
td
>
</
tr
>
</
xsl:for-each
>
</
xsl:template
>
<
xsl:template
match
=
"/udt:UserDefinedTable"
>
<
xsl:variable
name
=
"currentData"
select
=
"udt:Data"
/>
<
xsl:if
test
=
"$currentData"
>
<
table
>
<!-- DEFINE ANY HEADERS HERE, EXAMPLE IS FOR TABLE TYPE LISTING -->
<!-- Parameter header is optional! -->
<!--
<
tr
>
<
td
/>
<
td
class
=
"NormalBold UDT_Table_Head"
>
<
xsl:apply-templates
select
=
"udt:Fields[udt:FieldTitle='NameOfColumn']"
>
<
xsl:with-param
name
=
"header"
select
=
"NewHeaderName"
/>
</
xsl:apply-templates
>
</
td
>...
</
tr
>
-->
<
xsl:apply-templates
select
=
"$currentData"
mode
=
"list"
>
<
xsl:sort
select
=
"*[name()=$param_orderby]"
order
=
"{$orderDirection}"
data-type
=
"{$orderType}"
/>
</
xsl:apply-templates
>
</
table
>
</
xsl:if
>
</
xsl:template
>
<
xsl:template
match
=
"udt:Fields"
name
=
"SortingHeader"
>
<
xsl:param
name
=
"header"
select
=
"udt:FieldTitle"
/>
<
xsl:if
test
=
"udt:Visible='true' or udt:Visible='True'"
>
<
a
>
<
xsl:attribute
name
=
"href"
>
<
xsl:choose
>
<
xsl:when
test
=
"udt:ValueColumn=$param_orderby"
>
<
xsl:variable
name
=
"flippedDirection"
>
<
xsl:choose
>
<
xsl:when
test
=
"$orderDirection='ascending'"
>
<
xsl:text
>descending</
xsl:text
>
</
xsl:when
>
<
xsl:otherwise
>
<
xsl:text
>ascending</
xsl:text
>
</
xsl:otherwise
>
</
xsl:choose
>
</
xsl:variable
>
?<
xsl:value-of
select
=
"$prefix_param"
/>_orderby=<
xsl:value-of
select
=
"udt:ValueColumn"
/>&<
xsl:value-of
select
=
"$prefix_param"
/>_direction=<
xsl:value-of
select
=
"$flippedDirection"
/></
xsl:when
>
<
xsl:otherwise
>
?<
xsl:value-of
select
=
"$prefix_param"
/>_orderby=<
xsl:value-of
select
=
"udt:ValueColumn"
/>&<
xsl:value-of
select
=
"$prefix_param"
/>_direction=<
xsl:value-of
select
=
"$orderDirection"
/></
xsl:otherwise
>
</
xsl:choose
>
</
xsl:attribute
>
<!--flipped order direction-->
<
xsl:value-of
select
=
"$header"
/>
<
xsl:if
test
=
"udt:ValueColumn=$param_orderby"
>
<
img
src
=
"{//udt:Context/udt:ApplicationPath}/images/sort{$orderDirection}.gif"
border
=
"0"
/>
</
xsl:if
>
</
a
>
</
xsl:if
>
</
xsl:template
>
<
xsl:template
name
=
"EditLink"
>
<
xsl:if
test
=
"udt:EditLink"
>
<
a
href
=
"{udt:EditLink}"
>
<
img
border
=
"0"
alt
=
"edit"
src
=
"{//udt:Context/udt:ApplicationPath}/images/edit.gif"
/>
</
a
>
</
xsl:if
>
</
xsl:template
>
</
xsl:stylesheet
>