changeset 7:4d7f45e51e8e

add step2.xsl; add RDF to step1.xsl
author paulo@twcdns.fastsearch.net
date Sat, 11 Sep 2010 03:35:23 -0700
parents 2be1a035d725
children 8afd18e103c7
files myrss/step1.xsl myrss/step2.xsl
diffstat 2 files changed, 36 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/myrss/step1.xsl	Sat Sep 11 02:49:56 2010 -0700
     1.2 +++ b/myrss/step1.xsl	Sat Sep 11 03:35:23 2010 -0700
     1.3 @@ -1,6 +1,12 @@
     1.4  <?xml version="1.0" encoding="ISO-8859-1"?>
     1.5 -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://www.w3.org/2005/Atom" xmlns="http://www.pauloang.com/">
     1.6 +<xsl:stylesheet version="1.0"
     1.7 +		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     1.8 +		xmlns:a="http://www.w3.org/2005/Atom"
     1.9 +		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    1.10 +		xmlns:r1="http://purl.org/rss/1.0/"
    1.11 +		xmlns="http://www.pauloang.com/">
    1.12  
    1.13 +<!-- Atom -->
    1.14  <xsl:template match="/a:feed">
    1.15  <site>
    1.16  <title><xsl:value-of select="a:title"/></title>
    1.17 @@ -14,6 +20,7 @@
    1.18  </site>
    1.19  </xsl:template>
    1.20  
    1.21 +<!-- RSS -->
    1.22  <xsl:template match="rss/channel">
    1.23  <site>
    1.24  <title><xsl:value-of select="title"/></title>
    1.25 @@ -27,4 +34,18 @@
    1.26  </site>
    1.27  </xsl:template>
    1.28  
    1.29 +<!-- RDF -->
    1.30 +<xsl:template match="rdf:RDF">
    1.31 +<site>
    1.32 +<title><xsl:value-of select="r1:channel/r1:title"/></title>
    1.33 +<link><xsl:value-of select="r1:channel/r1:link"/></link>
    1.34 +<xsl:for-each select="r1:item">
    1.35 +	<headline>
    1.36 +	<title><xsl:value-of select="r1:title"/></title>
    1.37 +	<link><xsl:value-of select="r1:link"/></link>
    1.38 +	</headline>
    1.39 +</xsl:for-each>
    1.40 +</site>
    1.41 +</xsl:template>
    1.42 +
    1.43  </xsl:stylesheet>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/myrss/step2.xsl	Sat Sep 11 03:35:23 2010 -0700
     2.3 @@ -0,0 +1,14 @@
     2.4 +<?xml version="1.0" encoding="ISO-8859-1"?>
     2.5 +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pba="http://www.pauloang.com/">
     2.6 +<xsl:output method="html"/>
     2.7 +
     2.8 +<xsl:template match="pba:site">
     2.9 +<H2><A HREF="{pba:link}"><xsl:value-of select="pba:title"/></A></H2>
    2.10 +<P>
    2.11 +<xsl:for-each select="pba:headline">
    2.12 +	<A HREF="{pba:link}"><xsl:value-of select="pba:title"/></A> -
    2.13 +</xsl:for-each>
    2.14 +</P>
    2.15 +</xsl:template>
    2.16 +
    2.17 +</xsl:stylesheet>