This repository has been archived on 2026-03-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
TP-BDD2/python/TP1.py
2022-03-05 21:48:39 +01:00

18 lines
685 B
Python
Executable File

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)