xslt - unique elements with XSL generate-key() -


First of all, thank you all who answered. I am posting similar information here in the interest of avoiding confusion, but updated questions accordingly.

My problem is that for every one shown below my XSL does not execute, it shows that there is nothing in the result set, however, I do not know why more details below.

Input Structure

  & lt; AllMyResults & gt; & Lt; Results & gt; & Lt; SomeElement & gt; Price & lt; / State & gt; & Lt; Other Elements & gt; Price 2 & lt; / State & gt; & Lt; Subject & gt; Get unique themes! & Lt; / State & gt; & Lt; / Results & gt; & Lt; / AllMyResults & gt;   

I have a key word at the top of my XSL file

    [2]  The meat of my XSL file, which uses a different input structure:  
  & lt; Xsl: for-small = "$ result end / subject [generated-id () = generate-id (key ('subject', 'subject') [1])]" & gt; ... this point never arrives ... & lt; / Xsl: each -G & gt; The input structure used by [2] above is a list of elements    

What I'm remembering here Am I I used the debugger to determine that it was never executed for each, which indicates that the expression $ ResultSet / subject [gener-id () = gener-id (key ('SubjectKey' , 'Subject') [1])] was empty set. but why?

Additional information

$ resulted in a node as a result. It was a parameter passed in the template. According to my debugger, the "key" statement is executed in the appropriate amount of time - once "subject" appears in my input file, what I have read about generating - id (), no parameter Instead, it is running on the current node, instead I have tried all kinds of variations ( $ ResultSet / * / subject , $ ResultSet / subject Code> $ ResultSet / * , etc.)

Please believe that this should be the key ('subject', subject) , not key ('subject', 'subject') (note citation) And that Word should not be on $ ResultSet , no $ ResultSet / subject :

  $ ResultSet [gener-id () = Generate-ID (key ('subject', subject) [1])]    

Comments