$xml_file = "media/xml/screenings.xml";
// Variables for input file
$xml_screening_date_key = "*SCREENINGS*FILMSCREENING*DATE";
$xml_screening_address_key = "*SCREENINGS*FILMSCREENING*ADDRESS";
$xml_screening_city_key = "*SCREENINGS*FILMSCREENING*CITY";
$xml_screening_infoLink_key = "*SCREENINGS*FILMSCREENING*INFOLINK";
$xml_tv_date_key = "*SCREENINGS*TVSCREENING*DATE";
$xml_tv_channel_key = "*SCREENINGS*TVSCREENING*CHANNEL";
$xml_tv_additional_key = "*SCREENINGS*TVSCREENING*ADDITIONAL";
$xml_tv_infoLink_key = "*SCREENINGS*TVSCREENING*INFOLINK";
$filmCounter = 0;
$tvCounter = 0;
class xml_tvscreening {
var $xml_tv_date_key, $xml_tv_infoLink_key, $xml_tv_channel_key;
}
class xml_screening {
var $xml_screening_date_key, $xml_screening_address_key, $xml_screening_city_key, $xml_screening_infoLink_key;
}
function startTag($parser, $data) {
global $current_tag;
$current_tag .= "*$data";
}
function endTag($parser, $data) {
global $current_tag;
$tag_key = strrpos($current_tag, '*');
$current_tag = substr($current_tag, 0, $tag_key);
}
function contents($parser, $data) {
global $xml_screening_date_key, $xml_screening_address_key, $xml_screening_city_key, $xml_screening_infoLink_key, $xml_tv_date_key, $xml_tv_infoLink_key, $xml_tv_channel_key, $xml_tv_additional_key, $current_tag, $filmCounter, $tvCounter;
switch($current_tag) {
case $xml_screening_date_key:
if($filmCounter == 0) {
echo 'FILM SCREENINGS';
}
echo '