[XML-SIG] Different results on Windows and Linux

Christian Zagrodnick cz@gocept.com
Thu, 27 Feb 2003 17:31:15 +0100


Hi there

running the following little script on both windows (active state python
2.2.2 with pyxml 0.8.2) and linux (python 2.2.2 with same pyxml)

from xml.dom.minidom import parseString
doc = parseString('<alpha><beta no="a"><gamma><delta>1</delta></gamma><delta mark="foo">2</delta><gamma mark="bar"><delta>3</delta></gamma></beta><beta no="b"><delta>4</delta><gamma><delta>5</delta></gamma></beta></alpha>')
from xml import xpath
from xml.xpath.Context import Context
context = Context(doc, 0, 0)
print xpath.Evaluate('/alpha/beta[attribute::no = 1]', context=context)

results in [] (correct) on windows and [<DOM Element: beta at 0x820fd54>, 
<DOM Element: beta at 0x8209a74>] (wrong) on Linux.

This probably has todo with Python's broken NaN implementation.
Nevertheless it should work on all platforms.

-- 
Christian Zagrodnick

gocept gmbh & co. kg - schalaunische strasse 6 - 06366 koethen/anhalt
fon. +49 3496 3099112, +49 179 1463644,  +31 645 266224
fax. +49 3496 3099118