initial cpmmit
This commit is contained in:
17
python/TP1.py
Executable file
17
python/TP1.py
Executable file
@@ -0,0 +1,17 @@
|
||||
from xml.dom import minidom
|
||||
doc = minidom.parse('../xml/TP1.xml')
|
||||
|
||||
print(doc.getElementsByTagName('Q1')[0].toxml()) # Représentation textuelle du sous-arbre
|
||||
print(doc.getElementsByTagName('personne')[0].getAttribute('nom'))
|
||||
print(doc.getElementsByTagName('personne')[0].getAttribute('prenom'))
|
||||
|
||||
print(doc.getElementsByTagName('personne')[0].childNodes)
|
||||
|
||||
print(doc.getElementsByTagName('personne')[0].childNodes[1].firstChild.data)
|
||||
print(doc.getElementsByTagName('personne')[0].childNodes[3].firstChild.data)
|
||||
print(doc.getElementsByTagName('personne')[0].childNodes[3].getAttribute('code'))
|
||||
|
||||
|
||||
#print(doc.getElementsByTagName('sfq'))
|
||||
#print(doc.getElementsByTagName('telephone').data)
|
||||
|
||||
Reference in New Issue
Block a user