Mercurial > genshi > mirror
changeset 282:24b3cbbc1b1b trunk
Fix `starts-with()` XPath function so that it actually compares the two strings. Closes #61.
author | cmlenz |
---|---|
date | Mon, 09 Oct 2006 20:45:17 +0000 |
parents | faf7fc3cbacf |
children | a86653e29c75 |
files | genshi/path.py genshi/tests/path.py |
diffstat | 2 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/genshi/path.py +++ b/genshi/path.py @@ -802,7 +802,7 @@ """ __slots__ = ['string1', 'string2'] def __init__(self, string1, string2): - self.string1 = string2 + self.string1 = string1 self.string2 = string2 def __call__(self, kind, data, pos, namespaces, variables): string1 = self.string1(kind, data, pos, namespaces, variables)
--- a/genshi/tests/path.py +++ b/genshi/tests/path.py @@ -363,6 +363,8 @@ xml = XML('<root><foo>bar</foo></root>') path = Path('*[starts-with(name(), "f")]') self.assertEqual('<foo>bar</foo>', path.select(xml).render()) + path = Path('*[starts-with(name(), "b")]') + self.assertEqual('', path.select(xml).render()) def test_predicate_string_length_function(self): xml = XML('<root><foo>bar</foo></root>')