I think the problem is due to the nodes you are applying the distinct() against. You are applying the 'sager' template against the '$sager/bynavn' - which wont process that. I've modified your XSLT, see if this works:
I thought it best to test this out... and I can't seem to get the 'distinct()' function to work! :-(
I keep getting the following exception (via the "umbDebugShowTrace=true" querystring)
umbracoMacro InnerException Value cannot be null.
Parameter name: type
Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at umbraco.presentation.xslt.Exslt.ExsltCommon.ExsltNodeListToXPathNodeIterator(ExsltNodeList list)
I've tried various ways of passing the node-set, (and different XML sources too), but nothing works.
Hmmm... could be a bug in the eXSLT implementation? or am I doing something wrong?
Personally I've used the "Muenchian" method several times, works well, but takes a little time to understand how it works; with key indexes and generate-id().
@Lee - For what it's worth, your example works as expected with xsltproc on my Mac, so I'm guessing a bug in the EXSLT.NET (or what it's called) implementation...
distinct values using Exslt.ExsltSets:distinct
Hi, can anyone help selecting distinct values from the node 'bynavn' in the following xml :
Here is my xslt so far, it just displays the nodes text as one text string.
Hi Peter,
I think the problem is due to the nodes you are applying the distinct() against. You are applying the 'sager' template against the '$sager/bynavn' - which wont process that. I've modified your XSLT, see if this works:
Now we apply the 'bynavn' template against the distinct node-set, rather than trying to do that per 'sag' item.
Hope this makes sense?
Cheers, Lee.
I thought it best to test this out... and I can't seem to get the 'distinct()' function to work! :-(
I keep getting the following exception (via the "umbDebugShowTrace=true" querystring)
I've tried various ways of passing the node-set, (and different XML sources too), but nothing works.
Hmmm... could be a bug in the eXSLT implementation? or am I doing something wrong?
Anyone got any ideas?
Cheers, Lee.
Peter, in the meantime, take a look at this other forum thread for an alternative approach:
http://our.umbraco.org/forum/developers/xslt/4482-xslt-distinct
Personally I've used the "Muenchian" method several times, works well, but takes a little time to understand how it works; with key indexes and generate-id().
Good luck, Lee.
@Lee - For what it's worth, your example works as expected with xsltproc on my Mac, so I'm guessing a bug in the EXSLT.NET (or what it's called) implementation...
/Chriztian
is working on a reply...