[Mono-bugs] [Bug 72343][Nor] New - string/number comparison fails on node-set variables

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 8 Feb 2005 10:44:33 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by atsushi@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=72343

--- shadow/72343	2005-02-08 10:44:33.000000000 -0500
+++ shadow/72343.tmp.6169	2005-02-08 10:44:33.000000000 -0500
@@ -0,0 +1,92 @@
+Bug#: 72343
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: atsushi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: string/number comparison fails on node-set variables
+
+This set of stylesheet/document does not result in expected output:
+
+hello.xml:
+
+<?xml version="1.0" encoding="utf-8"?>
+<weather>
+        <temperatures city="Miami">
+                <temperature>67</temperature>
+                <temperature>62</temperature>
+                <temperature>78</temperature>
+                <temperature>72</temperature>
+        </temperatures>
+</weather>
+
+hello.xsl:
+
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+        <xsl:output method="html"/>
+
+        <xsl:template match="/weather/temperatures">
+
+<!--
+                <xsl:variable name="mid">
+                        <xsl:copy-of select=".//temperature[1]"/>
+                </xsl:variable>
+-->
+
+                <xsl:variable name="mid" select=".//temperature[1]"/>
+                <xsl:variable name="small" select=".//temperature[2]"/>
+                <xsl:variable name="big" select=".//temperature[3]"/>
+
+                <xsl:choose>
+                        <xsl:when test="$big &gt; $mid">good</xsl:when>
+                        <xsl:otherwise>BAD!!!</xsl:otherwise>
+                </xsl:choose>
+                <xsl:choose>
+                        <xsl:when test="$mid &gt; $small">good</xsl:when>
+                        <xsl:otherwise>BAD!!!</xsl:otherwise>
+                </xsl:choose>
+        </xsl:template>
+</xsl:stylesheet>
+
+trans.cs:
+
+using System;
+using System.Xml;
+using System.Xml.Xsl;
+
+public class Test
+{
+        public static void Main (string [] args)
+        {
+                XslTransform t = new XslTransform ();
+                t.Load (args [0] + ".xsl");
+                t.Transform (args [0] + ".xml", args [0] + ".out");
+        }
+}
+
+Steps to reproduce the problem:
+1. mcs trans.cs
+2. mono trans.exe hello
+3. cat hello.out
+
+Actual Results:
+BAD!!!BAD!!!
+
+Expected Results:
+goodgood
+
+How often does this happen? 
+consistently.
+
+Additional Information: