Edgewall Software

Changeset 347

Show
Ignore:
Timestamp:
10/09/2006 10:45:17 PM (2 years ago)
Author:
cmlenz
Message:

Fix starts-with() XPath function so that it actually compares the two strings. Closes #61.

Location:
trunk/genshi
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/genshi/path.py

    r322 r347  
    803803    __slots__ = ['string1', 'string2'] 
    804804    def __init__(self, string1, string2): 
    805         self.string1 = string2 
     805        self.string1 = string1 
    806806        self.string2 = string2 
    807807    def __call__(self, kind, data, pos, namespaces, variables): 
  • trunk/genshi/tests/path.py

    r322 r347  
    364364        path = Path('*[starts-with(name(), "f")]') 
    365365        self.assertEqual('<foo>bar</foo>', path.select(xml).render()) 
     366        path = Path('*[starts-with(name(), "b")]') 
     367        self.assertEqual('', path.select(xml).render()) 
    366368 
    367369    def test_predicate_string_length_function(self):