You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by wk...@apache.org on 2012/01/13 13:19:10 UTC

svn commit: r1231034 - in /incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt: functions.xsl rdfa.xslt rel-design-pattern2rdf.xsl

Author: wkasper
Date: Fri Jan 13 12:19:09 2012
New Revision: 1231034

URL: http://svn.apache.org/viewvc?rev=1231034&view=rev
Log:
Fixed errors related to unresolved relative URLs

Modified:
    incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/functions.xsl
    incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/rdfa.xslt
    incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/rel-design-pattern2rdf.xsl

Modified: incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/functions.xsl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/functions.xsl?rev=1231034&r1=1231033&r2=1231034&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/functions.xsl (original)
+++ incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/functions.xsl Fri Jan 13 12:19:09 2012
@@ -37,6 +37,12 @@
         	</xsl:call-template>
         </xsl:variable>
         <xsl:choose>
+        	<xsl:when test="starts-with($ref,'//')">
+        	<!--  prefix is just the protocol part -->
+        	<!--	<xsl:value-of select="concat(substring-before($baseUri,':'),':',$ref)"/> -->
+        	<!--  hard code the prefix for Stanbol because there we will not see the real URLs anyway -->
+        		<xsl:value-of select="concat('http:',$ref)"/>
+        	</xsl:when>
         	<xsl:when test="starts-with($ref,'/')">
         		<xsl:value-of select="concat($baseUri,$ref)"/>
        		</xsl:when>

Modified: incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/rdfa.xslt
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/rdfa.xslt?rev=1231034&r1=1231033&r2=1231034&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/rdfa.xslt (original)
+++ incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/rdfa.xslt Fri Jan 13 12:19:09 2012
@@ -367,6 +367,9 @@
      <when test="not(contains($curie_or_uri,'://')) and not(starts-with($curie_or_uri,'/'))"> <!-- relative URL -->
       <value-of select="concat($this_location,$curie_or_uri)" />
      </when>
+     <when test="not(contains($curie_or_uri,'://')) and starts-with($curie_or_uri,'//')"> <!-- protocol only -->
+      <value-of select="concat(substring-before($this_root,':'),':',$curie_or_uri)" />
+     </when>
      <when test="not(contains($curie_or_uri,'://')) and (starts-with($curie_or_uri,'/'))"> <!-- URL from root domain -->
       <value-of select="concat($this_root,substring-after($curie_or_uri,'/'))" />
      </when>

Modified: incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/rel-design-pattern2rdf.xsl
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/rel-design-pattern2rdf.xsl?rev=1231034&r1=1231033&r2=1231034&view=diff
==============================================================================
--- incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/rel-design-pattern2rdf.xsl (original)
+++ incubator/stanbol/trunk/enhancer/engines/metaxa/src/main/resources/xslt/rel-design-pattern2rdf.xsl Fri Jan 13 12:19:09 2012
@@ -70,7 +70,14 @@
 
 	<!-- rel-license pattern -->
 	<xsl:template match="*[@rel='license']">
-		<dc:license rdf:resource="{@href}" />
+		<xsl:variable name="href" select="@href" />
+		<xsl:variable name="hrefForm">
+			<xsl:call-template name="resolveUri">
+				<xsl:with-param name="base" select="$uri" />
+				<xsl:with-param name="ref" select="$href" />
+			</xsl:call-template>
+		</xsl:variable>		
+		<dc:license rdf:resource="{$hrefForm}" />
 	</xsl:template>
 
 	<!--  TODO: rel-bookmark, rel-me, rel-contact, ... ? -->