From: Reinhold Kainhofer Date: Wed, 5 Mar 2008 15:59:17 +0000 (+0100) Subject: MusicXML: Properly detect when a node is the lxml tree is a comment X-Git-Tag: release/2.11.42-1~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=9fca602defd316cc01cd3d421f9a65342ed76289;p=lilypond.git MusicXML: Properly detect when a node is the lxml tree is a comment --- diff --git a/python/musicxml.py b/python/musicxml.py index 7c398e1e5d..0e63c5ecdb 100644 --- a/python/musicxml.py +++ b/python/musicxml.py @@ -953,9 +953,8 @@ def get_class (name): def lxml_demarshal_node (node): name = node.tag - # TODO: This is a nasty hack, but I couldn't find any other way to check - # if the given node is a comment node (class _Comment): - if name is None or re.match (u"^$", node.__repr__()): + # Ignore comment nodes, which are also returned by the etree parser! + if name is None or node.__class__.__name__ == "_Comment": return None klass = get_class (name) py_node = klass()