Fix typed selection for token '(name)'
- Check the type but yield the element
This commit is contained in:
parent
04258f5c43
commit
52d3220f8d
|
@ -6,6 +6,7 @@ CHANGELOG
|
|||
===============
|
||||
* Fix descendant shortcut operator '//'
|
||||
* Fix text() function
|
||||
* Fix typed select of '(name)' token
|
||||
|
||||
`v1.2.1`_ (2019-08-30)
|
||||
======================
|
||||
|
|
|
@ -304,11 +304,13 @@ def select(self, context=None):
|
|||
yield self.xsd_type.decode(item[1])
|
||||
elif is_element_node(item, name):
|
||||
if self.xsd_type.is_simple():
|
||||
yield self.xsd_type.decode(item)
|
||||
self.xsd_type.validate(item.text)
|
||||
else:
|
||||
yield item
|
||||
self.xsd_type.validate(item)
|
||||
yield item
|
||||
except (TypeError, ValueError):
|
||||
self.wrong_sequence_type("Type %r does not match sequence type of %r" % (self.xsd_type, item))
|
||||
msg = "Type {!r} does not match sequence type of {!r}"
|
||||
self.wrong_sequence_type(msg.format(self.xsd_type, item))
|
||||
|
||||
|
||||
###
|
||||
|
|
Loading…
Reference in New Issue