title: Use value for dynamic xpath on xslt 1.0
body: <p>my question/target is: How can I generate the content in firstPart?</p>
  
  <p>(My compiler can't dynamic evaluate()-functions and is based on XSLT 1.0 (VB.NET). I only want to use board tools.)</p>
  
  <p>The output should consist of 2 main parts. In the first part I want to iterate over the person and choose the one which was described in /root/choosePerson. The second part consist of all the persons, which are in /root/person.</p>
  
  <p>Now it's getting difficult: In the output I should get an ID-Attribute, referring to the Person in firstPart. The secondPart has a slight other algorithm, which doesn't show the birthdate.</p>
  
  <p>input.xml:</p>
  
  <pre><code>&lt;root&gt;
  &lt;person&gt; &lt;name&gt;bart&lt;/name&gt; &lt;gender&gt;m&lt;/gender&gt; &lt;birth&gt;01.01.2016&lt;/birth&gt; &lt;/person&gt;
  &lt;person&gt; &lt;name&gt;lisa&lt;/name&gt; &lt;gender&gt;w&lt;/gender&gt; &lt;birth&gt;01.01.2015&lt;/birth&gt; &lt;/person&gt;
  &lt;person&gt; &lt;name&gt;homer&lt;/name&gt; &lt;gender&gt;m&lt;/gender&gt; &lt;birth&gt;01.01.2014&lt;/birth&gt; &lt;/person&gt;
  &lt;choosePerson&gt;choose person: 1&lt;/choosePerson&gt;&lt;!-- it really consist of string and a number --&gt;
  &lt;root&gt;
  </code></pre>
  
  <p>output.xml:</p>
  
  <pre><code>&lt;MyNewRoot&gt;
  &lt;firstPart&gt;
  &lt;person id="1" gender="m"&gt;&lt;name&gt;bart&lt;/name&gt; &lt;birth&gt;01.01.2016&lt;/birth&gt; &lt;/person&gt;
  &lt;firstPart&gt;
  &lt;secondPart&gt;
  &lt;person id="1" gender="m"&gt; &lt;name&gt;bart&lt;/name&gt;  &lt;/person&gt;
  &lt;person id="2" gender="w"&gt; &lt;name&gt;lisa&lt;/name&gt;  &lt;/person&gt;
  &lt;person id="3" gender="m"&gt; &lt;name&gt;homer&lt;/name&gt;  &lt;/person&gt;
  &lt;/secondPart&gt;
  &lt;MyNewRoot&gt;
  </code></pre>
  
  <p>What whould I do? I could start with the second part at first:</p>
  
  <pre><code>&lt;xsl:template match="/"&gt;
  &lt;firstPart&gt;
  
  &lt;firstPart&gt;
  &lt;secondPart&gt;
  &lt;xsl:apply-templates select="//root/person"/&gt;
  &lt;/secondPart&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="//root/person""&gt;
  &lt;!-- incomplete code (for the sake of clarity), but here I copy the values and create an id through the position() method --&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>I know dynamic XPaths are not possible and there are also hybrid variants. But are dynamic Xpaths because of "choosePerson" necessary?</p>