jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rve...@apache.org
Subject svn commit: r1600005 - /jena/trunk/jena-fuseki/pages/xml-to-html-links.xsl
Date Wed, 04 Jun 2014 08:39:23 GMT
Author: rvesse
Date: Wed Jun  4 08:39:22 2014
New Revision: 1600005

URL: http://svn.apache.org/r1600005
Log:
Apply JENA-708 patch from Sarven Capadisli

Modified:
    jena/trunk/jena-fuseki/pages/xml-to-html-links.xsl

Modified: jena/trunk/jena-fuseki/pages/xml-to-html-links.xsl
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/pages/xml-to-html-links.xsl?rev=1600005&r1=1600004&r2=1600005&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/pages/xml-to-html-links.xsl (original)
+++ jena/trunk/jena-fuseki/pages/xml-to-html-links.xsl Wed Jun  4 08:39:22 2014
@@ -129,14 +129,21 @@ URIs as hrefs in results : Bob DuCharme 
     <xsl:text>&gt;</xsl:text>
   </xsl:template>
 
-  <xsl:template match="res:literal[@datatype]">
-	<!-- datatyped literal value -->
-    "<xsl:value-of select="."/>"^^&lt;<xsl:value-of select="@datatype"/>&gt;
-  </xsl:template>
-
-  <xsl:template match="res:literal[@lang]">
-	<!-- datatyped literal value -->
-    "<xsl:value-of select="."/>"<xsl:value-of select="@xml:lang"/>
+  <xsl:template match="res:literal">
+    <xsl:text>"</xsl:text>
+    <xsl:value-of select="text()"/>
+    <xsl:text>"</xsl:text>
+
+    <xsl:choose>
+      <xsl:when test="@datatype">
+        <!-- datatyped literal value -->
+        ^^&lt;<xsl:value-of select="@datatype"/>&gt;
+      </xsl:when>
+      <xsl:when test="@xml:lang">
+        <!-- lang-string -->
+        @<xsl:value-of select="@xml:lang"/>
+      </xsl:when>
+    </xsl:choose>
   </xsl:template>
 
   <xsl:template match="res:sparql">
@@ -180,4 +187,4 @@ URIs as hrefs in results : Bob DuCharme 
       </body>
     </html>
   </xsl:template>
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>



Mime
View raw message