Applying XSL to an RSS feed
In this recipe, we will create a styled HTML file based on an existing RSS feed and XSL (stylesheet).
Getting ready
The files needed for this recipe are included in the downloadable book scripts from the Packt website. Once you've downloaded the files, copy the XML Files\RSS
folder to your local C:\
directory. This folder will have two files: one sample RSS feed (sample_rss.xml
) and one XSL file (rss_style.xsl
).
How to do it...
These are the steps required for styling an RSS feed:
- Open PowerShell ISE as an administrator.
- Add the following script and run it:
#replace these with the paths of the files in your system Set-Alias ie "$env:programfiles\Internet" #remove $rss variable if it already exists if ($rss) { Remove-Variable -Name "rss" } #replace these with the paths of the files in your system $xsl = "C:\DATA\RSS\rss_style.xsl" $rss = "C:\DATA\RSS\sample_rss.xml" $styled_rss = "C:\DATA\RSS\sample_result.html"...