forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r566883 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl
Date Thu, 16 Aug 2007 23:04:41 GMT
Author: rgardler
Date: Thu Aug 16 16:04:40 2007
New Revision: 566883

URL: http://svn.apache.org/viewvc?view=rev&rev=566883
Log:
Add maintainers to JSON

Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl?view=diff&rev=566883&r1=566882&r2=566883
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-JSON.xsl
Thu Aug 16 16:04:40 2007
@@ -21,7 +21,8 @@
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
   xmlns:doap="http://usefulinc.com/ns/doap#"
-  xmlns:dc="http://purl.org/dc/elements/1.1/">
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+  xmlns:foaf="http://xmlns.com/foaf/0.1/">
   <xsl:template match="/">{ "items": [<xsl:apply-templates select="descriptors"/>]}

   </xsl:template>
   
@@ -39,6 +40,7 @@
   <xsl:template match="doap:Project">
     "label":"<xsl:value-of select="doap:name"/>",
     <xsl:call-template name="categories"/>
+    <xsl:call-template name="maintainers"/>
     <xsl:apply-templates select="doap:name|doap:shortdesc|doap:homepage"/>
   </xsl:template>
   
@@ -46,9 +48,23 @@
     "<xsl:value-of select="local-name(.)"/>":"<xsl:apply-templates select="@rdf:resource"/>"<xsl:if
test="not(position()=last())">, </xsl:if>
   </xsl:template>
   
+  <xsl:template name="maintainers">
+    <xsl:if test="doap:maintainer|doap:developer|doap:helper">
+      "person" : [<xsl:apply-templates select="doap:maintainer|doap:developer|doap:helper"/>],
+    </xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="doap:maintainer|doap:developer|doap:helper">
+    <xsl:apply-templates select="foaf:Person"/><xsl:if test="not(position()=last())">,
</xsl:if>
+  </xsl:template>
+  
+  <xsl:template match="foaf:Person">
+    "<xsl:value-of select="foaf:name"/>"
+  </xsl:template>
+  
   <xsl:template name="categories">
     <xsl:if test="doap:category">
-      "Category" : [<xsl:apply-templates select="doap:category"/>],
+      "category" : [<xsl:apply-templates select="doap:category"/>],
     </xsl:if>
   </xsl:template>
   



Mime
View raw message