<xsl:param name="getterURL" select="''"/>
<xsl:param name="uri_set_queueURL" select="''"/>
<xsl:param name="uri_set_size" select="30"/>
-<xsl:variable name="base_URL_of_CIC_URI" select="concat($getterURL,'getxml?uri=')"/>
+<xsl:variable name="base_URL_of_URI" select="concat($getterURL,'getxml?uri=')"/>
<!-- 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 -->
</xsl:choose>
</xsl:template>
+<!-- The next function is used to quote URIs to embed them in an URL -->
+<xsl:template name="quote_url">
+ <xsl:param name="s" select="''"/>
+ <xsl:param name="news" select="''"/>
+ <xsl:choose>
+ <xsl:when test="$s = ''"><xsl:value-of select="$news"/></xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="char" select="substring($s,1,1)"/>
+ <xsl:choose>
+ <xsl:when test="$char = '#'">
+ <xsl:call-template name="quote_url">
+ <xsl:with-param name="s" select="substring($s,2)"/>
+ <xsl:with-param name="news" select="concat($news,'%23')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="quote_url">
+ <xsl:with-param name="s" select="substring($s,2)"/>
+ <xsl:with-param name="news" select="concat($news,$char)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template name="removeXPointer">
+ <xsl:param name="uri" select="''"/>
+ <xsl:variable name="before" select="substring-before($uri,'#xpointer')"/>
+ <xsl:choose>
+ <xsl:when test="$before=''">
+ <xsl:value-of select="$uri"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$before"/>
+ </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:text>strict digraph L0 { size = "83,83"; node [style=filled, shape = box];&CSCbr;</xsl:text>
+ <xsl:variable name="quoted_CICURI">
+ <xsl:call-template name="quote_url">
+ <xsl:with-param name="s" select="$CICURI"/>
+ </xsl:call-template>
+ </xsl:variable>
<!-- The nonce is used to force the document reload -->
- <xsl:variable name="dummy0" select="document(concat($uri_set_queueURL,'set_uri_set_size?uri=',$CICURI,'&nonce=',generate-id(),'&PID=',$PID,'&size=',$uri_set_size))"/>
- <xsl:variable name="dummy1" select="document(concat($uri_set_queueURL,'add_if_not_in?uri=',$CICURI,'&nonce=',generate-id(),'&PID=',$PID))"/>
- <xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',$CICURI,'&nonce=',generate-id(),'&PID=',$PID))"/>
+ <xsl:variable name="dummy0" select="document(concat($uri_set_queueURL,'set_uri_set_size?uri=',$quoted_CICURI,'&nonce=',generate-id(),'&PID=',$PID,'&size=',$uri_set_size))"/>
+ <xsl:variable name="dummy1" select="document(concat($uri_set_queueURL,'add_if_not_in?uri=',$quoted_CICURI,'&nonce=',generate-id(),'&PID=',$PID))"/>
+ <xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',$quoted_CICURI,'&nonce=',generate-id(),'&PID=',$PID))"/>
<xsl:variable name="dummy2" select="document(concat($uri_set_queueURL,'reset_to_empty?PID=',$PID))"/>
<xsl:text>}</xsl:text>
</xsl:template>
<xsl:template mode="loop" match="empty"/>
<xsl:template mode="loop" match="uri|marked_uri">
- <xsl:apply-templates mode="first_time" select="document(concat($base_URL_of_CIC_URI,@value))/*">
+ <xsl:variable name="rawuri">
+ <xsl:call-template name="removeXPointer">
+ <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>
<xsl:with-param name="do_not_visit" select="name(.)"/>
</xsl:apply-templates>
+ <xsl:variable name="quoted_value">
+ <xsl:call-template name="quote_url">
+ <xsl:with-param name="s" select="@value"/>
+ </xsl:call-template>
+ </xsl:variable>
<!-- The couple (uri,nonce) is used to force the document reload -->
- <xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',@value,'&nonce=',generate-id(),'&PID=',$PID))"/>
+ <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:call-template>
</xsl:variable>
<!-- The nonce is used to force the document reload -->
- <xsl:variable name="dummy0" select="document(concat($uri_set_queueURL,'set_uri_set_size?uri=',$CICURI,'&nonce=',generate-id(),'&PID=',$PID,'&size=',$uri_set_size))"/>
+ <xsl:variable name="dummy0" select="document(concat($uri_set_queueURL,'set_uri_set_size?uri=',$quoted_CICURI,'&nonce=',generate-id(),'&PID=',$PID,'&size=',$uri_set_size))"/>
<xsl:variable name="dummy1" select="document(concat($uri_set_queueURL,'add_if_not_in?uri=',$quoted_CICURI,'&nonce=',generate-id(),'&PID=',$PID))"/>
<xsl:apply-templates mode="loop" select="document(concat($uri_set_queueURL,'get_next?uri=',$quoted_CICURI,'&nonce=',generate-id(),'&PID=',$PID))"/>
<xsl:variable name="dummy2" select="document(concat($uri_set_queueURL,'reset_to_empty?PID=',$PID))"/>