Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm struggling with an xslt that is suppose to give me some distinct values that I'm gonna use as options in a select.
Here is what I've got:
<xsl:variable name="make" select="umbraco.library:Request('make')"/>
<xsl:variable name="alldata" select="umbraco.library:GetXmlNodeById(1674)/Leasingcar"/>
<xsl:variable name="prods" select="msxml:node-set($alldata) [wwleasingform/MultiNodePicker/nodeId = $make]" />
<xsl:for-each select="msxml:node-set($prods) ">
<xsl:if test="generate-id() = generate-id(msxml:node-set($prods)[. = current()])">
The for-each gives me : Mercedes, BMW, BMW, Audi and it should give me Mercedes, BMW, Audi
So I guess someting in the for-each isn't right.
Can someone see what I'm doing wrong?
I think you're missing a key in the above code - See the example by Tommy here http://blackpoint.dk/umbraco-workbench/xslt/grouping--distinct-values.aspx?p=3
Perhaps you can also find further inspiration in this thread https://our.umbraco.org/forum/developers/xslt/4482-xslt-distinct - Only be aware that since these examples where created the XML schema of Umbraco changed - So if you see "node/data[@alias ='something']" a lot, which was the old way to do the XSLT back then. Just mentioning so you don't get confused by it :)
Hope this helps!
Thanks, it' helped
You were right. Got it to work with this:
<xsl:key name="lcars" match="leasingcar" use="."/>
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted