Note that there are some explanatory texts on larger screens.

plurals
  1. POXSL : how to select a unique nodes in a nodeset
    primarykey
    data
    text
    <p>I have been reading on the different question talking about selecting unique nodes in a document (using the Muenchian method) but in my case I cannot use keys (or I do not know how) because I am working on a node set and not on the document.</p> <p>And keys cannot be set on a node-set. Basically I have a variable:</p> <pre><code>&lt;xsl:variable name="limitedSet" select=" $deviceInstanceNodeSet[position() &amp;lt;= $tableMaxCol]" /&gt; </code></pre> <p>which contains <code>&lt;deviceInstance&gt;</code> nodes which themselves containing <code>&lt;structure&gt;</code> elements the node set may be represented this way:</p> <pre><code>&lt;deviceInstance name="Demux TSchannel" deviceIndex="0"&gt; &lt;structure name="DemuxTschannelCaps"&gt; &lt;/structure&gt; &lt;/deviceInstance&gt; &lt;deviceInstance name="Demux TSchannel" deviceIndex="1"&gt; &lt;structure name="DemuxTschannelCaps"&gt; &lt;/structure&gt; &lt;/deviceInstance&gt; &lt;deviceInstance name="Demux TSchannel" deviceIndex="3"&gt; &lt;structure name="otherCaps"&gt; &lt;/structure&gt; &lt;/deviceInstance&gt; </code></pre> <p>And I do not know a to select <code>&lt;structure&gt;</code> elements that only have different name. The select would in this example return two <code>&lt;structure&gt;</code> elements, being:</p> <pre><code>&lt;structure name="DemuxTschannelCaps"&gt;&lt;/structure&gt; &lt;structure name="otherCaps"&gt;&lt;/structure&gt; </code></pre> <p>I have tried </p> <pre><code>select="$limitedSet//structure[not(@name=preceding::structure/@name)]" </code></pre> <p>but the preceding axis goes all along the document and not the <code>$limitedSet</code>?</p> <p>I am stuck, can someone help me. Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload