[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Searching text with elements help needed

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

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

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">                                                          
  ***CROSSREFERENCE_FOUND***                                                                    
   <xsl:apply-templates/>                                                                       
 </xsl:template>                                                                                
 <xsl:template match="Para">                                                                    
  <P>                                                                                           
<!--      <xsl:analyze-string select="." regex="For more                                        
+information[^\*]*\*\*\*CROSSREFERENCE_FOUND\*\*\*[^\.\?!]*[\.\?!]"> -->                        
      <xsl:analyze-string select="." regex="(For more information[^\.\?!]*[\.\?!])">            
                                                                                                
        <xsl:matching-substring>                                                                
           <xsl:value-of select="concat('Found', regex-group(1), 'Found end')" />               
                                                                                                
        </xsl:matching-substring>                                                               
      </xsl:analyze-string>                                                                     
   <xsl:apply-templates/>                                                                       
  </P>                                                                                          
 </xsl:template>  

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!

Russ

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.