Nachsehen in XML-Datei
Hallo Pyhton-Forum Ich bin neu in Python (das wird man gleich an der Art der Frage erkennen :-) ) Habe folgendes Problem: M|chte aus einer Datenbankanwendung (Informix, medizinisches Praxisprogramm) in einer XML-Datei nachsehen und den Datensatz mit einer bestimmten Pharma-Nummer auslesen und anzeigen. Das kleine Pyhtonprogramm soll aus dieser Anwendung mit dem Parameter "Pharma-Nummer" aufgerufen werden, um in der besteheneden XML-Datei nach dieser Nummer zu suchen, um den gefundenen Datensatz anzuzeigen. Meine Frage: Wo kann ich zu suchen anfangen, wie man ein solches Programm angeht? Habe bisher das Python-Tutorial gelesen, aber keinen Hinweis gefunden, wie man in XML-Dateien suchen kann. Bitte um Tipps Danke Philipp
--On 17. September 2007 10:20:49 +0200 Philipp Walderdorff <ph.walderdorff@gmx.at> wrote:
Meine Frage: Wo kann ich zu suchen anfangen, wie man ein solches Programm angeht? Habe bisher das Python-Tutorial gelesen, aber keinen Hinweis gefunden, wie man in XML-Dateien suchen kann.
In dem Du das XML Dokument parsen lässen (mit einem XML Parser) und dann die entsprechenden Methoden des Parsers anwendest, um die Dinge zu suchen, die Du finden willst. Z.B. via "Elementtree" Modul: <http://effbot.org/zone/element.htm> "Searching for subelements".... -aj
participants (2)
-
Andreas Jung
-
Philipp Walderdorff