]> git.donarmstrong.com Git - lilypond.git/commit
MusicXML: Fix using lxml as XML parser
authorReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 25 Feb 2008 12:14:25 +0000 (13:14 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 25 Feb 2008 12:14:25 +0000 (13:14 +0100)
commitbfc268fc6fa45db3262a740757457c95b561614e
tree6fd9607f666ea739012eb96cd8303df4d51611b0
parent07ea6396c855b6140d1e5b111a4aa7ee2aa7e5cf
MusicXML: Fix using lxml as XML parser

Unfortunately, the default lxml.etree parser also includes comments
in its tree, which does not return a string as its tag, but a built-in
function Comment. Thus, I need to filter out all these comments.
It seems that lxml does not have any convenient way to check whether
a given node is a comment, so I convert it to its string representation
and compare with "<!--.*-->". Of course, this is a bad hack, but I haven't
found a better way yet.
python/musicxml.py