title: XSLT Template Match 'middle' child
body: <p>I am new to XSLT and was wandering how to match the 'middle' child/sibling nodes? (so basically all those which are not first or last)</p>
  
  <p>For example, say i have the following xml....</p>
  
  <pre><code>&lt;FRUITS&gt;
    &lt;FRUIT&gt;Apple&lt;/FRUIT&gt;
    &lt;FRUIT&gt;Pear&lt;/FRUIT&gt;     &lt;!--I want to match this in a template--&gt;
    &lt;FRUIT&gt;Banana&lt;/FRUIT&gt;   &lt;!--I want to match this in a template--&gt;
    &lt;FRUIT&gt;..........&lt;/FRUIT&gt;
  &lt;/FRUITS&gt; 
  </code></pre>
  
  <p>The example above is just a very short example of the xml i am working on. However in the real xml i will never know how many fruit siblings there are. So in other words i am looking to construct a statement that will identify if a node has following-siblings and preceding-siblings together. I have looked at the following but no joy as the syntax is not correct.....</p>
  
  <pre><code>&lt;xsl:template match="FRUIT[preceding-sibling::FRUIT*]/[following-sibling::FRUIT*]" /&gt;
  </code></pre>
  
  <p>And also....</p>
  
  <pre><code>&lt;xsl:template match="FRUIT[preceding-sibling::FRUIT*] and [following-sibling::FRUIT*]" /&gt;
  </code></pre>
  
  <p>This is using XSLT 1.0</p>
  
  <p>Any help would be most appreciated</p>