[libxslt] Fix system-property with unknown namespace



commit abb7c65980c7da450f0447dcc6a1821eef99d473
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Wed Aug 15 23:06:14 2012 +0200

    Fix system-property with unknown namespace
    
    The empty string should be returned, see bug #631803.

 libxslt/functions.c       |    4 +++-
 tests/docs/bug-176.xml    |    1 +
 tests/general/bug-176.out |    2 ++
 tests/general/bug-176.xsl |   11 +++++++++++
 4 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/libxslt/functions.c b/libxslt/functions.c
index de962f4..01852b8 100644
--- a/libxslt/functions.c
+++ b/libxslt/functions.c
@@ -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
index 0000000..69d62f2
--- /dev/null
+++ b/tests/docs/bug-176.xml
@@ -0,0 +1 @@
+<doc/>
diff --git a/tests/general/bug-176.out b/tests/general/bug-176.out
new file mode 100644
index 0000000..e829790
--- /dev/null
+++ b/tests/general/bug-176.out
@@ -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
index 0000000..6996e1e
--- /dev/null
+++ b/tests/general/bug-176.xsl
@@ -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>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]