svn commit: r578193 - in /lenya/sandbox/modules/person: resources/schemas/foaf.rng sitemap.xmap xslt/foaf2xhtml.xsl xslt/knows2include.xsl
[email protected] Fri, 21 Sep 2007 16:15:39 -0000
Newsgroups
gmane.comp.cms.lenya.cvs
Message-ID
<[email protected] >
Author: andreas
Date: Fri Sep 21 09:15:38 2007
New Revision: 578193
URL: http://svn.apache.org/viewvc?rev=578193&view=rev
Log:
Adding foaf:knows to person module
Added:
lenya/sandbox/modules/person/xslt/knows2include.xsl
Modified:
lenya/sandbox/modules/person/resources/schemas/foaf.rng
lenya/sandbox/modules/person/sitemap.xmap
lenya/sandbox/modules/person/xslt/foaf2xhtml.xsl
Modified: lenya/sandbox/modules/person/resources/schemas/foaf.rng
URL: http://svn.apache.org/viewvc/lenya/sandbox/modules/person/resources/schemas/foaf.rng?rev=578193&r1=578192&r2=578193&view=diff
==============================================================================
--- lenya/sandbox/modules/person/resources/schemas/foaf.rng (original)
+++ lenya/sandbox/modules/person/resources/schemas/foaf.rng Fri Sep 21 09:15:38 2007
@@ -25,6 +25,13 @@
<data type="anyURI"/>
</attribute>
</element>
+ <zeroOrMore>
+ <element name="foaf:knows">
+ <attribute name="rdf:resource">
+ <data type="anyURI"/>
+ </attribute>
+ </element>
+ </zeroOrMore>
</element>
</element>
</start>
Modified: lenya/sandbox/modules/person/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/sandbox/modules/person/sitemap.xmap?rev=578193&r1=578192&r2=578193&view=diff
==============================================================================
--- lenya/sandbox/modules/person/sitemap.xmap (original)
+++ lenya/sandbox/modules/person/sitemap.xmap Fri Sep 21 09:15:38 2007
@@ -33,6 +33,8 @@
<!-- {format}.xml/{pubId}/{area}/{uuid}/{language} -->
<map:match pattern="*.*/*/*/*/*">
<map:generate src="lenya-document:{5},lang={6}{link:rev}"/>
+ <map:transform src="fallback://lenya/modules/person/xslt/knows2include.xsl"/>
+ <map:transform type="cinclude"/>
<map:transform src="fallback://lenya/modules/person/xslt/foaf2{1}.xsl">
<map:parameter name="rendertype" value="{request-param:rendertype}"/>
</map:transform>
Modified: lenya/sandbox/modules/person/xslt/foaf2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/sandbox/modules/person/xslt/foaf2xhtml.xsl?rev=578193&r1=578192&r2=578193&view=diff
==============================================================================
--- lenya/sandbox/modules/person/xslt/foaf2xhtml.xsl (original)
+++ lenya/sandbox/modules/person/xslt/foaf2xhtml.xsl Fri Sep 21 09:15:38 2007
@@ -80,6 +80,19 @@
<a href="{$homepage}"><xsl:value-of select="$homepage"/></a>
</td>
</tr>
+ <tr>
+ <th>Knows:</th>
+ <td>
+ <xsl:for-each select="foaf:knows">
+ <a href="{@rdf:resource}">
+ <xsl:value-of select="rdf:RDF/foaf:Person/foaf:givenname"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="rdf:RDF/foaf:Person/foaf:family_name"/>
+ </a>
+ <br/>
+ </xsl:for-each>
+ </td>
+ </tr>
</table>
</xsl:template>
Added: lenya/sandbox/modules/person/xslt/knows2include.xsl
URL: http://svn.apache.org/viewvc/lenya/sandbox/modules/person/xslt/knows2include.xsl?rev=578193&view=auto
==============================================================================
--- lenya/sandbox/modules/person/xslt/knows2include.xsl (added)
+++ lenya/sandbox/modules/person/xslt/knows2include.xsl Fri Sep 21 09:15:38 2007
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:foaf="http://xmlns.com/foaf/0.1/"
+ xmlns:ci="http://apache.org/cocoon/include/1.0"
+ >
+
+ <xsl:template match="foaf:knows">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <ci:include src="{@rdf:resource}"/>
+ </xsl:copy>
+ </xsl:template>
+
+
+ <xsl:template match="@*|node()" priority="-1">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file