Selecting the following siblings


Source document

Your are at the green marked position

  <product id="1" name="Teekanne" price="25.00" category="1" />
  <product id="2" name="Bleistift" price="0.29" category="2" />
  <product id="3" name="Lautsprecher" price="19.00" category="2" />
  <product id="4" name="Tasse" price="1.99" category="1" />
  <product id="5" name="Apfelsaft" price="1.49" category="1" />
  <product id="6" name="CD-Rohling" price="0.89" category="2" />
  <category id="1" name="Sortiment 2005" />
  <category id="2" name="Sortiment 2006" />


Select the following product-siblings relatively from their current node.

Desired selection (XML-output)

  • <product id="4" name="Tasse" price="1.99" category="1" />
  • <product id="5" name="Apfelsaft" price="1.49" category="1" />
  • <product id="6" name="CD-Rohling" price="0.89" category="2" />


Your input

Eine Lösung wäre: Lösung