From a411b020690aa97af21433d6d3b6970f2ed77a1c Mon Sep 17 00:00:00 2001 From: Josef Friedrich Date: Sat, 20 Jan 2024 18:49:12 +0100 Subject: [PATCH] Clean up --- mscxyz/xml.py | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/mscxyz/xml.py b/mscxyz/xml.py index 9e885ca..2a67a29 100644 --- a/mscxyz/xml.py +++ b/mscxyz/xml.py @@ -310,24 +310,3 @@ def remove_tags(self, *element_paths: str) -> Xml: for element in self.findall(path): self.remove(element) return self - - def remove_tags_by_xpath(self, *xpath_strings: str) -> None: - """Remove tags by xpath strings. - - :param xpath_strings: A xpath string. - - .. code:: Python - - tree.remove_tags_by_xpath( - '/museScore/Score/Style', '//LayoutBreak', '//StemDirection' - ) - - """ - for xpath_string in xpath_strings: - x: _XPathObject = self.root.xpath(xpath_string) - if isinstance(x, list): - for rm in x: - if isinstance(rm, _Element): - p: _Element | None = rm.getparent() - if isinstance(p, _Element): - p.remove(rm)