Python: Promote xml.etree modeling

This commit is contained in:
Rasmus Wriedt Larsen
2022-03-31 10:42:05 +02:00
parent 7f5f7679f8
commit 64aa503cc3
4 changed files with 119 additions and 118 deletions

View File

@@ -2,7 +2,7 @@ match = "dc:title"
ns = {'dc': 'http://purl.org/dc/elements/1.1/'}
import xml.etree.ElementTree as ET
tree = ET.parse('country_data.xml')
tree = ET.parse('country_data.xml') # $ decodeFormat=XML decodeInput='country_data.xml' decodeOutput=ET.parse(..) xmlVuln='Billion Laughs' xmlVuln='Quadratic Blowup'
root = tree.getroot()
root.find(match, namespaces=ns) # $ getXPath=match