xsl-list
[Top] [All Lists]

RE: [xsl] Retrieve images from a RSS feed

2007-05-18 02:02:23
Hello Nic,

With this it's still not possible to extract the image to a local disk.
Or I'm wrong ?

Regards Rien. 

-----Oorspronkelijk bericht-----
Van: Nic James Ferrier [mailto:nferrier(_at_)tapsellferrier(_dot_)co(_dot_)uk] 
Verzonden: vrijdag 18 mei 2007 10:29
Aan: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Onderwerp: Re: [xsl] Retrieve images from a RSS feed

"M. David Peterson" <m(_dot_)david(_at_)xmlhacker(_dot_)com> writes:

On Thu, 17 May 2007 13:53:31 -0600, Rien van Herpen (@Home) 
<R(_dot_)van(_dot_)Herpen(_at_)home(_dot_)nl> wrote:

Is there a way to extract the images from a RSS feed via XSL

Use an extension function. A generic approach: Create a new file 
stream, access the image via the proper protocol, write the bytes to 
the file stream, close the file stream, save the file stream to disk.  
Dependent upon whether you are using .NET or Java, there are more 
efficients ways to handle this for each platform.

The XSL looks like this:

 <xsl:template match="/">
     <xsl:for-each select="//enclosure[starts-with(@type, 'image/')]">
        <xsl:value-of select="@href"/>
     </xsl:for-each>
 </xsl:template>


--
Nic Ferrier
http://www.tapsellferrier.co.uk   

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>