[xsl] Searching text with elements help needed

Subject: [xsl] Searching text with elements help needed
From: Russell Urquhart <russurquhart1@xxxxxxxxxxx>
Date: Thu, 17 Jun 2010 18:46:24 -0500
I have been tasked with trying to find a sentence in a <Para> element similar to the following:

Some text...For more information see <CrossReference>ItemofInterest</CrossReference>. Some more text, etc.

I have to determine if a sentence of the "For more information see <CrossReference> </CrossReference>." and, ideally delete it, but i would be just as happy to put it in comments.

I was trying the following in a template:

<xsl:template match="CrossReference">                                                          
 <xsl:template match="Para">                                                                    
<!--      <xsl:analyze-string select="." regex="For more                                        
+information[^\*]*\*\*\*CROSSREFERENCE_FOUND\*\*\*[^\.\?!]*[\.\?!]"> -->                        
      <xsl:analyze-string select="." regex="(For more information[^\.\?!]*[\.\?!])">            
           <xsl:value-of select="concat('Found', regex-group(1), 'Found end')" />               

Regular <Para> elements are translated to html <P> elements. I had tried to convert the <CrossReference> element to text thinking that would help the search process, but no dice.

Can someone shed some light on how i should approach this and or have an example to share!

Thanks for any help!


Current Thread