right now the gpos.xpath("//Lookup") ends up selecting and removing GSUB lookups of type 2, 4, 5 and 6 as well, even though we only intended to prune the GPOS ones.
That's the way // works, it will select all matching elements following the current node anywhere they appear, not only their descendants. GSUB follows GPOS since ttx sorts table alphabetically.
Putting a dot in front .// ensures only the descendants of the current node are selected.
right now the
gpos.xpath("//Lookup")
ends up selecting and removing GSUB lookups of type 2, 4, 5 and 6 as well, even though we only intended to prune the GPOS ones.That's the way
//
works, it will select all matching elements following the current node anywhere they appear, not only their descendants. GSUB follows GPOS since ttx sorts table alphabetically. Putting a dot in front.//
ensures only the descendants of the current node are selected.see https://www.w3schools.com/xml/xpath_syntax.asp