title: XSLT RSS FEED - Combine substring-before and substring-after
body: <p>My apologies in advance if this question is really simple, but I can’t seem to find a way around this issue.</p>
  
  <p>I need a way to combine the substring-before and substring-after function in xsl so I have a start and end point within a description element of an RSS feed.</p>
  
  <p>In each description tag I want to extract everything from ‘Primary Title’ onwards, but stop as soon as it reaches the first <code>&lt;b&gt;</code> tag. </p>
  
  <p>I tried the following xsl without much success</p>
  
  <pre><code>&lt;?xml version="1.0" ?&gt;
  &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:template match="channel"&gt;
  &lt;xsl:for-each select="item"&gt;
  
  
  &lt;xsl:value-of select=substring-after(description, 'Primary Title:' /&gt;
  
  &lt;xsl:value-of select=substring-before(description, '&amp;ltb&amp;gt' /&gt;
  
  
  
  &lt;/xsl:for-each&gt;
  
  &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <hr>
  
  <p>Below is the XML I am currently working with.</p>
  
  <pre><code>&lt;rss version="2.0"&gt;
    &lt;channel&gt;
      &lt;item&gt;
        &lt;title&gt;Article_110224_081057&lt;/title&gt;
      &lt;description&gt;
  &lt;![CDATA[&lt;div&gt;&lt;b&gt;Description:&lt;/b&gt;This is my description&lt;b&gt;Primary Title:&lt;/b&gt;This is my primary title&lt;b&gt;Second Title:&lt;/b&gt;This is my second title title &lt;/div&gt;
  ]]&gt;
  &lt;/description&gt;
      &lt;/item&gt;
      &lt;item&gt;
        &lt;title&gt;Article_110224_081057&lt;/title&gt;  
       &lt;description&gt;
  &lt;![CDATA[&lt;div&gt;&lt;b&gt;Description:&lt;/b&gt;This is my description&lt;b&gt;Other Title:&lt;/b&gt;This is my other title&lt;b&gt;Second Title:&lt;/b&gt;This is my second title titleb&lt;b&gt;Primary Title:&lt;/b&gt;This is my primary title&lt;b&gt; more text &lt;/div&gt;
  ]]&gt;
  &lt;/description&gt;
      &lt;/item&gt;
    &lt;/channel&gt;
  &lt;/rss&gt; 
  </code></pre>