List of mirrors on home page

Martin Horcicka horcicka at freebsd.cz
Tue Jan 6 20:35:29 UTC 2004


Hi,

Rudolf Cejka found a problem with the list of mirrors on home page. When I
export fresh doc and www trees from CVS and do "cd www/en; make index.html"
then I get empty list of mirrors:

>From index.html:

            <font color="#990000"><b>Select a server near
            you:</b></font><br />
            <select name="goto">
            </select><input type="submit" value=" Go " /><br />
            <font color="#990000"><b>Language:</b></font> <a

The problem seems to be in the XSLT template html-index-mirrors-options-list
defined in www/share/sgml/includes.misc.xsl. When I add the -v option to
XSLTPROCOPTS the relevant part of the output is:

call-template: name html-index-mirrors-options-list
Handling param mirrors.xml
        select $mirrors.xml
Building variable mirrors.xml select $mirrors.xml
Evaluating variable mirrors.xml
Lookup variable mirrors.xml
found variable mirrors.xml
Object is a string : /home/horcicka/tmp/www/en/../../doc/./sh...
applying template 'html-index-mirrors-options-list'
Registering param mirrors.xml
param mirrors.xml defined by caller
xsltForEach: select document($mirrors.xml)/mirrors/entry[country/@role != 'primary' and                           host[@type = 'www']/url[@proto = 'httpv6']]
Lookup variable mirrors.xml
found variable mirrors.xml
Initializing keys on /home/horcicka/tmp/www/en/../../doc/./share/sgml/mirrors.xml
xsltForEach: select evaluates to 0 nodes
xsltForEach: select document($mirrors.xml)/mirrors/entry[country/@role != 'primary' and                           host[@type = 'www']/url[@proto = 'http']]
Lookup variable mirrors.xml
found variable mirrors.xml
xsltForEach: select evaluates to 0 nodes
call-template returned: name html-index-mirrors-options-list

When the only thing I do is applying attached patch - i.e. instead of:

  country/@role != 'primary'

write:

  not(country/@role = 'primary')

in the definition of html-index-mirrors-options-list template then everything
works fine:

call-template: name html-index-mirrors-options-list
Handling param mirrors.xml
        select $mirrors.xml
Building variable mirrors.xml select $mirrors.xml
Evaluating variable mirrors.xml
Lookup variable mirrors.xml
found variable mirrors.xml
Object is a string : /home/horcicka/tmp/www/en/../../doc/./sh...
applying template 'html-index-mirrors-options-list'
Registering param mirrors.xml
param mirrors.xml defined by caller
xsltForEach: select document($mirrors.xml)/mirrors/entry[not(country/@role = 'primary') and                           host[@type = 'www']/url[@proto = 'httpv6']]
Lookup variable mirrors.xml
found variable mirrors.xml
Initializing keys on /home/horcicka/tmp/www/en/../../doc/./share/sgml/mirrors.xml
xsltForEach: select evaluates to 7 nodes

Has anyone met this problem as well? On www.FreeBSD.org everything looks fine
so I suppose the problem can be on our machine. We use libxslt-1.1.1.

Martin
-------------- next part --------------
--- www/share/sgml/includes.misc.xsl.orig	Tue Jan  6 21:18:29 2004
+++ www/share/sgml/includes.misc.xsl	Tue Jan  6 21:19:23 2004
@@ -105,7 +105,7 @@
   <xsl:template name="html-index-mirrors-options-list">
     <xsl:param name="mirrors.xml" select="''" />
 
-    <xsl:for-each select="document($mirrors.xml)/mirrors/entry[country/@role != 'primary' and
+    <xsl:for-each select="document($mirrors.xml)/mirrors/entry[not(country/@role = 'primary') and
                           host[@type = 'www']/url[@proto = 'httpv6']]">
       <xsl:sort select="country" />
 
@@ -123,7 +123,7 @@
       </xsl:for-each>
     </xsl:for-each>
 
-    <xsl:for-each select="document($mirrors.xml)/mirrors/entry[country/@role != 'primary' and
+    <xsl:for-each select="document($mirrors.xml)/mirrors/entry[not(country/@role = 'primary') and
                           host[@type = 'www']/url[@proto = 'http']]">
       <xsl:sort select="country" />
 


More information about the freebsd-doc mailing list