Fix system-property with unknown namespace
authorNick Wellnhofer <wellnhofer@aevum.de>
Wed, 15 Aug 2012 21:06:14 +0000 (23:06 +0200)
committerDaniel Veillard <veillard@redhat.com>
Thu, 16 Aug 2012 07:55:40 +0000 (15:55 +0800)
The empty string should be returned, see bug #631803.

libxslt/functions.c
tests/docs/bug-176.xml [new file with mode: 0644]
tests/general/bug-176.out [new file with mode: 0644]
tests/general/bug-176.xsl [new file with mode: 0644]

index de962f4..01852b8 100644 (file)
@@ -799,7 +799,9 @@ xsltSystemPropertyFunction(xmlXPathParserContextPtr ctxt, int nargs){
            } else {
                valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
            }
-       }
+       } else {
+           valuePush(ctxt, xmlXPathNewString((const xmlChar *)""));
+        }
        if (name != NULL)
            xmlFree(name);
        if (prefix != NULL)
diff --git a/tests/docs/bug-176.xml b/tests/docs/bug-176.xml
new file mode 100644 (file)
index 0000000..69d62f2
--- /dev/null
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/general/bug-176.out b/tests/general/bug-176.out
new file mode 100644 (file)
index 0000000..e829790
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<result/>
diff --git a/tests/general/bug-176.xsl b/tests/general/bug-176.xsl
new file mode 100644 (file)
index 0000000..6996e1e
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+               xmlns:msxsl="urn:schemas-microsoft-com:xslt"
+               exclude-result-prefixes="msxsl"
+               version="1.0">
+    <xsl:template match="/">
+        <result>
+            <xsl:value-of select="system-property('msxsl:version')"/>
+        </result>
+    </xsl:template>
+</xsl:transform>