Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] WiresharkXML.py

From: Christina Obermaier <christina.obermaier@xxxxxxxx>
Date: Wed, 1 Oct 2014 07:40:29 +0100
Hi,
I'm trying to build a Jenkins job which tests if my own dissector is working well.
Therefore i decided to use tshark and safe the results in a pdml file, which i want to check with a python script.

At the moment i only want to get the name and the value of the single attributes in my pdml file.

import WiresharkXML

def my_callback(packet):
    print (packet.get_name())
    print (packet.get_value())
    print ('test')

fh = open('pdml')
WiresharkXML.parse_fh(fh, my_callback)


But the fist two print statements only produce an empty line.
The 'test' word is written for each packet in my pdml file.

I hope you can help me
Greetings
Christina