title: How to populate element with attribute value using XPath
body: <p>When selecting a value for the "base" attribute in the category element, I'd like this value to automatically be inserted in the category element as plain text. For example, in the following code, I'd like the two category elements to include the values Video and Alarms, respectively. </p>
  
  <pre><code>    &lt;metadata&gt;
      &lt;category base="Video"/&gt;
      &lt;category base="Alarms"/&gt;
      &lt;/metadata&gt;
  </code></pre>
  
  <p>What XPath expression allows me to do this? The values for the base attribute are predefined in a separate XML file. I'm using Oxygen version 15.1.</p>
  
  <p>Thanks</p>
  
  <p>I apologize for the confusion. This is my source code:</p>
  
  <pre><code>    &lt;metadata&gt;
      &lt;category base="Video"/&gt;
      &lt;category base="Alarms"/&gt;
      &lt;/metadata&gt;
  </code></pre>
  
  <p>Through a custom XPath action, I'd like source code to resemble this:</p>
  
  <pre><code>  &lt;metadata&gt;
    &lt;category base="Video"&gt;Video&lt;/category&gt;
    &lt;category base="Alarms"&gt;Alarms&lt;/category&gt;
    &lt;/metadata&gt;
  </code></pre>
  
  <p>So, I'd like the element to take the value that is assigned to the "base" attribute. Oxygen comes bundled with custom XPath actions that allow you to do this sort of stuff. For example, through a custom action I can automatically populate an element with a specific string of text. However, in the above example, I don't want the category element to take a predefined string value, I want it to automatically take the value given to the "base" attribute. However, if I can't use XPath transform the document as has been stated, then I'm barking up the wrong tree!</p>