xsl-list
[Top] [All Lists]

RE: How can I return all urls in a string

2003-09-29 00:23:47
If you're restricted to XSLT 1.0, use a recursive template or an
xx:tokenize() extension function to break the text into words, then test
each word to see if it starts with "http://"; or "HTTP://".

Michael Kay


Of course, you're right.  Any url's that don't start with 
http:// or href will be ignored.  What I want to do is take 
an xml file like this:

<document>
<longstring>for more information look here: http://url.com  
for other products look here: http://moreinformation.com  to 
see a review go here: http://www.review.com. </longstring> </document>

and translate it into this:

<document>
     <url>http://url.com</url>
</document>

<document>
     <url>http://moreinformation.com</url>
</document>

<document>
     <url>http://www.review.com</url>
</document>

Thanks



                                                              
                                                              
                    
                      "Michael Kay"                           
                                                              
                    
                      <mhk(_at_)mhk(_dot_)me(_dot_)uk>                   To:  
 
    <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>                        
 
                    
                      Sent by:                          cc:   
                                                              
                    
                      owner-xsl-list(_at_)lists(_dot_)mulbe        
Subject:  RE: [xsl] How can I return all urls in a string     
                          
                      rrytech.com                             
                                                              
                    
                                                              
                                                              
                    
                                                              
                                                              
                    
                      09/28/2003 04:15 PM                     
                                                              
                    
                      Please respond to xsl-list              
                                                              
                    
                                                              
                                                              
                    





Please try to explain you question more clearly. What are you 
trying to do? What do you mean "Obviously I know the url will 
start with 'http://'
- how do you know this? (Many URLs do not start with this string).

Michael Kay


-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf 
Of Brian 
Benson
Sent: 28 September 2003 18:42
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] How can I return all urls in a string


I'm not sure how to do this.  Obviously I know the url will 
start with 
"http://"; but I don't know what it will end with. Any thoughts or 
pointers are appreciated.

Thanks



 XSL-List info and archive:  
http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info 
and archive:  http://www.mulberrytech.com/xsl/xsl-list






 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list