title: XSLT: Change part of a path string
body: <p>I am an XSLT 1.0 newbie.  In a string element in my XML, I want to change the directory parts of the path of a jar file (C:\abc\my.jar) to a static string and retain the jar file name ($PATH_VAR$\my.jar).</p>
  
  <p>The original XML snippet looks like:</p>
  
  <pre><code>&lt;object class="someclass"&gt;
     &lt;property name="path"&gt;
        &lt;string&gt;&lt;![CDATA[C:\abc\my.jar]]&gt;&lt;/string&gt;
     &lt;/property&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>and I want the transformed XML to be:</p>
  
  <pre><code>&lt;object class="someclass"&gt;
     &lt;property name="path"&gt;
        &lt;string&gt;&lt;![CDATA[$PATH_VAR$\my.jar]]&gt;&lt;/string&gt;
     &lt;/property&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>Note that the original path can be any length (\\xyz\abc or Z:\abc\def\ghi), and the jar file can be named anything.</p>
  
  <p>I'm not sure how to parse the original path string and change only the directories part of it.  Please help!</p>
  
  <p>-Jeff</p>