">
]>
-<xsl:stylesheet version="0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory">
+<xsl:stylesheet version="0.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:h="http:/www.cs.unibo.it/helm/schemas/schema-h.rdf#">
<xsl:output method="text"/>
<!-- CSC: next functions because I don't remember the name of the -->
<!-- CSC: subst function of xslt and I don't have the specs with me -->
+
+<!-- The next function is used to quote URIs for dotty -->
<xsl:template name="quote">
<xsl:param name="s" select="''"/>
<xsl:param name="news" select="''"/>
</xsl:choose>
</xsl:template>
-<xsl:template name="removeXPointer">
+<xsl:template name="RDFURI_of_CICURI">
<xsl:param name="uri" select="''"/>
- <xsl:variable name="before" select="substring-before($uri,'#xpointer')"/>
+ <xsl:variable name="base_RDF_URI" select="'helm:rdf:www.cs.unibo.it/helm/rdf/forward//'"/>
+ <xsl:variable name="before" select="substring-before($uri,'#xpointer(1/')"/>
+ <xsl:value-of select="$base_RDF_URI"/>
<xsl:choose>
<xsl:when test="$before=''">
<xsl:value-of select="$uri"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="$before"/>
+ <xsl:value-of select="concat($before,',')"/>
+ <xsl:variable name="after" select="substring-after($uri,'#xpointer(1/')"/>
+ <xsl:value-of select="translate(substring-before($after,')'),'/',',')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-<!-- CSC: Next function has been copied from -->
-<!-- CSC: metadata/xslt/occurrences.xsl and modified -->
-<xsl:template name="get_expanded_name">
- <xsl:param name="node" select="/.."/>
- <xsl:choose>
- <xsl:when test="name($node)='CONST'">
- <xsl:value-of select="$node/@uri"/>
- </xsl:when>
- <xsl:when test="name($node)='MUTIND'">
- <xsl:variable name="noType" select="$node/@noType + 1"/>
- <xsl:value-of select="concat($node/@uri,'#','xpointer(1/',
- $noType,')')"/>
- </xsl:when>
- <xsl:when test="name($node)='MUTCONSTRUCT'">
- <xsl:variable name="noType" select="$node/@noType + 1"/>
- <xsl:value-of select="concat($node/@uri,'#','xpointer(1/',
- $noType,'/',$node/@noConstr,')')"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- CSC: Is it possible to reach this branch? -->
- <xsl:value-of select="$node/@uri"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-
<xsl:template match="/">
<!--
<xsl:text>strict digraph L0 { size = "83,83"; concentrate=true; node [style=filled, shape = box];&CSCbr;</xsl:text>
<xsl:template mode="loop" match="empty"/>
<xsl:template mode="loop" match="uri|marked_uri">
- <xsl:variable name="rawuri">
- <xsl:call-template name="removeXPointer">
+ <xsl:variable name="rdfuri">
+ <xsl:call-template name="RDFURI_of_CICURI">
<xsl:with-param name="uri" select="@value"/>
</xsl:call-template>
</xsl:variable>
- <xsl:apply-templates mode="first_time" select="document(concat($base_URL_of_URI,$rawuri))/*">
- <xsl:with-param name="currentCICURI" select="@value"/>
- <xsl:with-param name="quotedCurrentCICURI">
- <xsl:call-template name="quote">
- <xsl:with-param name="s" select="@value"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="do_not_visit" select="name(.)"/>
- </xsl:apply-templates>
+ <xsl:variable name="document" select="document(concat($base_URL_of_URI,$rdfuri))"/>
+ <xsl:choose>
+ <xsl:when test="$document/*">
+ <xsl:apply-templates mode="first_time" select="$document/*">
+ <xsl:with-param name="currentCICURI" select="@value"/>
+ <xsl:with-param name="quotedCurrentCICURI">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="@value"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="do_not_visit" select="name(.)"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates mode="first_time" select=".">
+ <xsl:with-param name="currentCICURI" select="@value"/>
+ <xsl:with-param name="quotedCurrentCICURI">
+ <xsl:call-template name="quote">
+ <xsl:with-param name="s" select="@value"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="do_not_visit" select="'no_deps'"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
<xsl:variable name="quoted_value">
<xsl:call-template name="quote_url">
<xsl:with-param name="s" select="@value"/>
<xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',$quoted_value,'&nonce=',generate-id(),'&PID=',$PID))"/>
</xsl:template>
+
<xsl:template mode="first_time" match="*">
<xsl:param name="currentCICURI" select="''"/>
<xsl:param name="quotedCurrentCICURI" select="''"/>
<xsl:text>];&CSCbr;</xsl:text>
</xsl:template>
-<!-- CSC: uriType missing!!! -->
<xsl:template match="*">
<xsl:param name="currentCICURI" select="''"/>
<xsl:param name="quotedCurrentCICURI" select="''"/>
- <xsl:if test="@uri">
+ <xsl:for-each select="*/*/*">
<xsl:variable name="quotedURI">
<xsl:call-template name="quote">
- <xsl:with-param name="s">
- <xsl:call-template name="get_expanded_name">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:with-param>
+ <xsl:with-param name="s" select="@rdf:value"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="quoted_uri">
<xsl:call-template name="quote_url">
- <xsl:with-param name="s">
- <xsl:call-template name="get_expanded_name">
- <xsl:with-param name="node" select="."/>
- </xsl:call-template>
- </xsl:with-param>
+ <xsl:with-param name="s" select="@rdf:value"/>
</xsl:call-template>
</xsl:variable>
<!-- The nonce, quotedCurrentCICURI are used to force the document reload -->
<xsl:value-of select="$quotedURI"/>
<xsl:text>;&CSCbr;</xsl:text>
</xsl:if>
- </xsl:if>
- <xsl:apply-templates>
- <xsl:with-param name="currentCICURI" select="$currentCICURI"/>
- <xsl:with-param name="quotedCurrentCICURI" select="$quotedCurrentCICURI"/>
- </xsl:apply-templates>
+ </xsl:for-each>
</xsl:template>
-<xsl:template match="text()"/>
</xsl:stylesheet>