changeset 211:ee8fee3c4ae8

Tests: fix xslt tests for CentOS 5. Old libxslt used on CentOS 5 (libxml 2.6.26, libxslt 1.1.17) handlex XPath queries in top-level elements incorrectly if relative paths are used. Use paths from document root instead.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 23 Mar 2012 19:57:44 +0400
parents a5f810eb87a2
children a7cc4371f4ad
files xslt.t xslt_params.t
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/xslt.t
+++ b/xslt.t
@@ -46,7 +46,7 @@ http {
         }
         location /x2 {
             xslt_stylesheet %%TESTDIR%%/test.xslt
-                            param1='value1':param2=root param3='value%33';
+                            param1='value1':param2=/root param3='value%33';
         }
         location /x3 {
             xml_entities %%TESTDIR%%/entities.dtd;
@@ -77,7 +77,7 @@ test xslt result
 param1=<xsl:value-of select="$param1"/>
 param2=<xsl:value-of select="$param2"/>
 param3=<xsl:value-of select="$param3"/>
-data=<xsl:value-of select="root"/>
+data=<xsl:value-of select="/root"/>
 </xsl:template>
 
 </xsl:stylesheet>
@@ -90,7 +90,7 @@ EOF
                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
 <xsl:template match="/">
-<root>other <xsl:value-of select="root"/></root>
+<root>other <xsl:value-of select="/root"/></root>
 </xsl:template>
 
 </xsl:stylesheet>
--- a/xslt_params.t
+++ b/xslt_params.t
@@ -43,17 +43,17 @@ http {
 
         location /x1 {
             xslt_stylesheet %%TESTDIR%%/test.xslt
-                            param1='value1':param2=root param3='value%33';
+                            param1='value1':param2=/root param3='value%33';
         }
         location /x2 {
             xslt_stylesheet %%TESTDIR%%/test.xslt;
             xslt_param param1 "'value1'";
-            xslt_param param2 "root";
+            xslt_param param2 "/root";
             xslt_string_param param3 "value3";
         }
         location /x3 {
             xslt_stylesheet %%TESTDIR%%/test.xslt
-                            param1='value1':param2=root;
+                            param1='value1':param2=/root;
             xslt_string_param param3 "value3";
         }
     }