<?php
defined('BASEPATH') or exit('No direct script access allowed');
error_reporting(E_ALL & ~E_NOTICE);
class Parserfile
{

    protected $idLicitacion = 0;
    protected $datos_iniciales = array();
    protected $contrat_folder = array();
    protected $keyPadreRecursiva = "";
    protected $rutaDiaria = "";
    protected $rutaMensual = FCPATH . "DOWNLOADS/MONTH/format";
    protected $fechaInicioParser = "";
    protected $arrayLicitacionExiste = array();

    //TODO: Añadir los nodos que falten mirando la libreria de java
    //TODO Nuevo Nodo: Proveedor de pliegos->TenderingTerms->DocumentProviderParty
    //TODO Nuevo Nodo: Lugar de recepción->TenderingTerms->TenderRecipientParty
    //TODO Nuevo Nodo: Proveedor de información adicional->TenderingTerms->AdditionalInformationParty
    //TODO Nuevo Nodo: Información sobre recursos//Lugar de presentación de recursos//Fecha límite de presentación de recursos//Arbitraje->TenderingTerms->AppealTerms
    //TODO Nuevo Nodo: Eventos->TenderingProcess->OpenTenderEvent

    public function __construct()
    {
        $this->CI = &get_instance();
        $this->CI->load->helper('file');
        $this->CI->load->model("Parser_model");
        $this->CI->load->library('Parserdatabasebruto');
        $this->CI->load->library('Parserdatabaselimpio');
    }

    public function __destruct() {}

    public function index($rutaDiariaDownloader, $fechaInicioParser, $datosPerfil, $idUltimaImportacion)
    {
        $this->rutaDiaria = $rutaDiariaDownloader . "/format";
        $this->fechaInicioParser = $fechaInicioParser;
        $files = get_filenames($this->rutaDiaria, true);
        $filename = "";
        $xml = "";
        $array = "";
        $aux = 0;
        $resultEntries = array();
        $stats = array();

        foreach ($files as $file) {
            $filename = basename($file);
            $entrada = file_get_contents($file);
            $xml = simplexml_load_string($entrada, "SimpleXMLElement", LIBXML_NOCDATA);
            $array = json_decode(json_encode($xml), true);

            $aux = 0;

            $tablasTruncate = $this->CI->Parser_model->getMapaTablas();
            foreach ($tablasTruncate['datos'] as $row) {
                $this->CI->Parser_model->truncateTables($row->tabla_sucia);
            }
            $arrayDeletedEntries = array();
            $arrayDeletedEntries = $array['deleted-entry'];

            foreach ($array['entry'] as $clave => $row) {

                $existLicitacionActualizada = $this->getDatosLicitacion($row);

                if (!$existLicitacionActualizada) {

                    $resultEntries[$filename]['general'][$aux] = $this->nodoEntry($row, $xml->entry[$clave], $datosPerfil->id, $idUltimaImportacion, $arrayDeletedEntries);

                    $contractFolder = $this->nodoContractFolderStatus($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['contractInfo'][$aux] = $contractFolder;

                    $resultEntries[$filename]['locatedContractingParty'][$aux] = $this->nodoLocatedContractingParty($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['party'][$aux] = $this->nodoParty($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['procurementProject'][$aux] = $this->nodoPresupuesto($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['procurementProjectLot'][$aux] = $this->nodoProcurementProjectLot($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['tenderingTerms'][$aux] = $this->nodoTenderingTerms($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['tenderingProcess'][$aux] = $this->nodoTenderingProcess($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['tenderingResult'][$aux] = $this->nodoTenderResult($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['validNoticeInfo'][$aux] = $this->nodoValidNoticeInfo($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['legalDocs'][$aux] = $this->nodoLegalDoc($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['technicalDocs'][$aux] = $this->nodoTechnicalDocumentReference($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['generalDocs'][$aux] = $this->nodoGeneralDocuments($row, $xml->entry[$clave]);

                    $resultEntries[$filename]['additionalDocs'][$aux] = $this->nodoAdditionalDocumentReference($row, $xml->entry[$clave]);

                    $aux++;
                }

                //$this->recurseXML($array['entry'], true);
            }

            $this->CI->parserdatabasebruto->setDatosParser($resultEntries, $fechaInicioParser, $datosPerfil);
            unset($resultEntries[$filename]);
            unset($resultEntries);
            $this->arrayLicitacionExiste = array();
            unset($xml);
            unset($array);
            unset($tablasTruncate);
            $stats[$filename] = $this->CI->parserdatabaselimpio->index($fechaInicioParser, $filename);

            gc_mem_caches();
            gc_collect_cycles();
        }
    }

    public function echo_memory_usage()
    {
        $mem_usage = memory_get_usage(true);

        $result = "";
        if ($mem_usage < 1024) {
            $result = $mem_usage . " bytes";
        } elseif ($mem_usage < 1048576) {
            $result = round($mem_usage / 1024, 2) . " kilobytes";
        } else {
            $result = round($mem_usage / 1048576, 2) . " megabytes";
        }

        return $result;
    }

    private function getDatosLicitacion($xml): Bool
    {
        $idLicitacion = (string) substr($xml['id'], strrpos($xml['id'], '/') + 1);
        $fechaUpdated = (string) $xml['updated'];
        //$this->idLicitacion = $idLicitacion;
        $this->fechaUpdateLicitacion = $fechaUpdated;
        $result = false;

        if ($idLicitacion == "") {
            $var = 1;
        }

        if (!array_key_exists($idLicitacion, $this->arrayLicitacionExiste)) {
            $this->arrayLicitacionExiste[$idLicitacion] = $fechaUpdated;
        } else {
            $result = $this->existUpdatedLicitacion($idLicitacion, $fechaUpdated);
        }

        return $result;
    }

    private function existUpdatedLicitacion($idLicitacion, $fechaUpdated): Bool
    {
        $result = false;
        if (array_key_exists($idLicitacion, $this->arrayLicitacionExiste)) {
            $fechaExistente = $this->arrayLicitacionExiste[$idLicitacion];

            if ($fechaExistente >= $fechaUpdated) {
                $result = true;
            } else {
                $this->arrayLicitacionExiste[$idLicitacion] = $fechaUpdated;
                $result = false;
            }
        }

        return $result;
    }

    private function nodoEntry($xml, $xmlPrimitivo, $tipoPerfil, $idUltimaImportacion, $deletedEntry)
    {
        $resultEntries = array();
        $id_licitacion = (string) substr($xml['id'], strrpos($xml['id'], '/') + 1);
        $resultEntries['url_id_licitacion'] = (string) $xml['id'];
        $resultEntries['id_licitacion'] = $id_licitacion;
        $this->idLicitacion = $id_licitacion;
        $resultEntries['link_uri'] = (string) $this->existAttribute($xmlPrimitivo, "link", "string", 'href');
        $resultEntries['summary'] = (string) $xml['summary'];
        $resultEntries['title'] = (string) $xml['title'];
        $resultEntries['updated'] = (string) $xml['updated'];
        $resultEntries['tipo_perfil_licitacion'] = $tipoPerfil;
        $resultEntries['fecha_creacion_log'] = $this->fechaInicioParser;
        $resultEntries['id_importacion'] = $idUltimaImportacion;

        $resultEntries['estadoLicitacion'] = "VIGENTE";
        if ($deletedEntry) {
            foreach ($deletedEntry as $row) {
                $idBorrado = (string) substr($row['@attributes']["ref"], strrpos($row['@attributes']["ref"], '/') + 1);
                if ($id_licitacion == $idBorrado) {
                    $anyo1 = date_create($row['@attributes']['when']);
                    $anyo2 = date_create($resultEntries['updated']);
                    $diferencia = $anyo2->diff($anyo1);
                    $diferenciaFormat = $diferencia->y;
                    if ($diferenciaFormat > 5) {
                        $resultEntries['estadoLicitacion'] = "ARCHIVADA";
                    } else {
                        $resultEntries['estadoLicitacion'] = "ANULADA";
                    }
                }
            }
        }

        return $resultEntries;
    }

    private function nodoContractFolderStatus($xml, $xmlPrimitivo)
    {
        $resultEntries = array();
        if (array_key_exists("ContractFolderStatus", $xml)) {
            $contractFolder = $xml['ContractFolderStatus'];

            $resultEntries['ContractFolderID'] = (string) $contractFolder['ContractFolderID'];
            $resultEntries['ContractFolderStatusCode'] = (string) $contractFolder['ContractFolderStatusCode'];
            $resultEntries['ContractFolderStatusCodeAttr'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus, "ContractFolderStatusCode", "string", 'listURI');
            $resultEntries['id_ajena_licitacion'] = $this->idLicitacion;
            $resultEntries['id_compuesta'] = $this->idLicitacion . "_01";
            $resultEntries['fecha_creacion_log'] = $this->fechaInicioParser;
        }

        return $resultEntries;
    }

    private function nodoLocatedContractingParty($xml, $xmlPrimitivo)
    {
        $resultEntries = array();
        if (array_key_exists("LocatedContractingParty", $xml['ContractFolderStatus'])) {
            $LocatedContractingParty = $xml['ContractFolderStatus']['LocatedContractingParty'];

            $resultEntries['locatedContractingParty']['contractingPartyTypeCode'] = $this->existNodo($LocatedContractingParty, "ContractingPartyTypeCode", 'string');
            $resultEntries['locatedContractingParty']['contractingPartyTypeCodeUri'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->LocatedContractingParty, "ContractingPartyTypeCode", "string", 'listURI');
            //$resultEntries['locatedContractingParty']['contractingPartyTypeCodeUri'] = $this->existAttribute($LocatedContractingParty, "ContractingPartyTypeCode", 'string', 'listURI');

            if (array_key_exists("ActivityCode", $xml['ContractFolderStatus']['LocatedContractingParty'])) {
                $activity = $xml['ContractFolderStatus']['LocatedContractingParty']['ActivityCode'];
                if (!is_array($activity)) {
                    $activity = array(0 => $activity);
                }
                for ($i = 0; $i < count($activity); $i++) {
                    $resultEntries['activity'][$i]['activityCode'] = (string) $activity[$i];
                    //$resultEntries['activity'][$i]['activityCodeUri'] = (string) $activity[$i]->attributes()['listURI'];
                    $resultEntries['activity'][$i]['activityCodeUri'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->LocatedContractingParty, "ActivityCode", "string", 'listURI');
                    $resultEntries['activity'][$i]['id_ajena_licitacion'] = $this->idLicitacion;
                    $resultEntries['activity'][$i]['id_compuesta_padre'] = $this->idLicitacion . "_02_";
                    $resultEntries['activity'][$i]['id_compuesta'] = $this->idLicitacion . "_02_" . $i;
                    $resultEntries['activity'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
                }
            }

            $resultEntries['locatedContractingParty']['buyerProfileURIID'] = $this->existNodo($LocatedContractingParty, "BuyerProfileURIID", 'string');
            $resultEntries['locatedContractingParty']['id_ajena_licitacion'] = $this->idLicitacion;
            $resultEntries['locatedContractingParty']['id_compuesta'] = $this->idLicitacion . "_02";
            $resultEntries['locatedContractingParty']['fecha_creacion_log'] = $this->fechaInicioParser;
        }

        return $resultEntries;
    }

    private function nodoParty($xml, $xmlPrimitivo)
    {
        $resultEntries = array();
        if (array_key_exists("Party", $xml['ContractFolderStatus']['LocatedContractingParty'])) {
            $party = $xml['ContractFolderStatus']['LocatedContractingParty']['Party'];

            $resultEntries['party']['websiteURI'] = $this->existNodo($party, "WebsiteURI", 'string');

            if (array_key_exists("PartyIdentification", $party)) {
                for ($i = 0; $i < count($party['PartyIdentification']); $i++) {
                    $resultEntries['partyIdentification'][$i]['idPartyIdent'] = $this->existNodo($party['PartyIdentification'][$i], "ID", 'string');
                    //$resultEntries['partyIdentification'][$i]['attr'] = $this->existAttribute($party, $party['PartyIdentification'][$i]['ID'], "string", 'schemeName');
                    $resultEntries['partyIdentification'][$i]['attr'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->LocatedContractingParty->Party->PartyIdentification[$i], "ID", "string", 'schemeName');
                    $resultEntries['partyIdentification'][$i]['id_ajena_licitacion'] = $this->idLicitacion;
                    $resultEntries['partyIdentification'][$i]['id_compuesta'] = $this->idLicitacion . "_03_" . $i;
                    $resultEntries['partyIdentification'][$i]['id_compuesta_padre'] = $this->idLicitacion . "_03";
                    $resultEntries['partyIdentification'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
                }
            }

            $resultEntries['party']['partyName'] = $this->existNodo($party['PartyName'], "Name", 'string');
            $resultEntries['party']['city'] = $this->existNodo($party['PostalAddress'], "CityName", 'string');
            $resultEntries['party']['codpostal'] = $this->existNodo($party['PostalAddress'], "PostalZone", 'string');
            $resultEntries['party']['direccion'] = $this->existNodo($party['PostalAddress']['AddressLine'], "Line", 'string');
            $resultEntries['party']['country'] = $this->existNodo($party['PostalAddress']['Country'], "Name", 'string');
            $resultEntries['party']['contact_name'] = $this->existNodo($party['Contact'], "Name", 'string');
            $resultEntries['party']['contact_email'] = $this->existNodo($party['Contact'], "ElectronicMail", 'string');
            $resultEntries['party']['id_ajena_licitacion'] = $this->idLicitacion;
            $resultEntries['party']['id_compuesta'] = $this->idLicitacion . "_03";
            $resultEntries['party']['fecha_creacion_log'] = $this->fechaInicioParser;
        }
        return $resultEntries;
    }

    private function nodoPresupuesto($xml, $xmlPrimitivo)
    {
        $resultEntries = array();

        //$procurementProject = $xml->ContractFolderStatus->ProcurementProject;
        if (array_key_exists("ProcurementProject", $xml['ContractFolderStatus'])) {
            $procurementProject = $xml['ContractFolderStatus']['ProcurementProject'];

            $resultEntries['budget']['id_ajena_licitacion'] = $this->idLicitacion;
            $resultEntries['budget']['id_compuesta'] = $this->idLicitacion . "_04";
            $resultEntries['budget']['fecha_creacion_log'] = $this->fechaInicioParser;
            $resultEntries['budget']['name'] = $this->existNodo($procurementProject, 'Name', 'string');
            $resultEntries['budget']['typeCode'] = $this->existNodo($procurementProject, 'TypeCode', 'string');
            $resultEntries['budget']['subTypeCode'] = $this->existNodo($procurementProject, 'SubTypeCode', 'string');

            if (array_key_exists("BudgetAmount", $procurementProject)) {
                $resultEntries['budget']['estimatedOverallContractAmount'] = $this->existNodo($procurementProject['BudgetAmount'], 'EstimatedOverallContractAmount', 'string');
                $resultEntries['budget']['totalAmount'] = $this->existNodo($procurementProject['BudgetAmount'], 'TotalAmount', 'string');
                $resultEntries['budget']['taxExclusiveAmount'] = $this->existNodo($procurementProject['BudgetAmount'], 'TaxExclusiveAmount', 'string');
            }

            if (array_key_exists("RequiredCommodityClassification", $procurementProject)) {
                $firstKey = array_key_first($procurementProject['RequiredCommodityClassification']);
                if ($this->idLicitacion == "8815986") {
                    $var = 1;
                }
                if ($firstKey === "ItemClassificationCode") {
                    $procurementProject['RequiredCommodityClassification'] = array(0 => $procurementProject['RequiredCommodityClassification']);
                }

                for ($i = 0; $i < count($procurementProject['RequiredCommodityClassification']); $i++) {
                    $resultEntries['itemClass'][$i]['itemClassification_value'] = $this->existNodo($procurementProject['RequiredCommodityClassification'][$i], 'ItemClassificationCode', 'string');
                    //$resultEntries['itemClass'][$i]['itemClassification_attr'] = (string) $procurementProject['RequiredCommodityClassification'][$i]['ItemClassificationCode']['listURI'];
                    $resultEntries['itemClass'][$i]['itemClassification_attr'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->ProcurementProject->RequiredCommodityClassification[$i], "ItemClassificationCode", "string", 'listURI');
                    $resultEntries['itemClass'][$i]['id_ajena_licitacion'] = $this->idLicitacion;
                    $resultEntries['itemClass'][$i]['id_compuesta_padre'] = $this->idLicitacion . "_04";
                    $resultEntries['itemClass'][$i]['id_compuesta'] = $this->idLicitacion . "_04_" . $i;
                    $resultEntries['itemClass'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
                }
            }

            if (array_key_exists("RealizedLocation", $procurementProject)) {
                $resultEntries['budget']['countrySubentity'] = $this->existNodo($procurementProject['RealizedLocation'], 'CountrySubentity', 'string');
                if (array_key_exists("CountrySubentityCode", $procurementProject['RealizedLocation'])) {
                    $resultEntries['budget']['countrySubentityCode'] = $this->existNodo($procurementProject['RealizedLocation'], 'CountrySubentityCode', 'string');
                    $resultEntries['budget']['countrySubentityCode'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->ProcurementProject->RealizedLocation, "CountrySubentityCode", "string", 'listURI');
                    //$resultEntries['budget']['countrySubentityCodeAttr'] = $this->existAttribute($procurementProject['RealizedLocation'], "CountrySubentityCode", "string", 'listURI');
                }

                if (array_key_exists("Address", $procurementProject['RealizedLocation'])) {
                    $resultEntries['budget']['cityName'] = $this->existNodo($procurementProject['RealizedLocation']['Address']['Country'], 'CityName', 'string');
                    $resultEntries['budget']['IdentificationCode'] = $this->existNodo($procurementProject['RealizedLocation']['Address']['Country'], 'IdentificationCode', 'string');
                    $resultEntries['budget']['countryName'] = $this->existNodo($procurementProject['RealizedLocation']['Address']['Country'], 'Name', 'string');
                }
            }

            $resultEntries['budget']['durationMesure'] = $this->existNodo($procurementProject['PlannedPeriod'], 'DurationMeasure', 'string');
            $resultEntries['budget']['duracion_inicio'] = $this->existNodo($procurementProject['PlannedPeriod'], 'StartDate', 'string');
            $resultEntries['budget']['duracion_fin'] = $this->existNodo($procurementProject['PlannedPeriod'], 'EndDate', 'string');
            $resultEntries['budget']['medida'] = $this->existAttribute($xmlPrimitivo->ContractFolderStatus->ProcurementProject->PlannedPeriod, "DurationMeasure", "string", 'unitCode');
            //$resultEntries['budget']['medida'] = $this->existAttribute($procurementProject['PlannedPeriod'], "DurationMeasure", "string", 'unitCode');

            if (array_key_exists("ContractExtension", $procurementProject)) {
                $resultEntries['budget']['contractExtension'] = $this->existNodo($procurementProject['ContractExtension'], 'OptionsDescription', 'string');
            }
        }

        return $resultEntries;
    }

    private function nodoProcurementProjectLot($xml, $xmlPrimitivo)
    {
        $resultEntries = array();
        if (array_key_exists("ProcurementProjectLot", $xml['ContractFolderStatus'])) {
            $procurementProjectLot = $xml['ContractFolderStatus']['ProcurementProjectLot'];
            $firstKey = array_key_first($procurementProjectLot);

            if ($firstKey !== 0) {
                $procurementProjectLot = array(0 => $procurementProjectLot);
            }
            for ($i = 0; $i < count($procurementProjectLot); $i++) {
                $resultEntries["lot"][$i]['idProcurementLot'] = $this->existNodo($procurementProjectLot[$i], 'ID', 'string');
                $resultEntries["lot"][$i]['name'] = $this->existNodo($procurementProjectLot[$i]['ProcurementProject'], 'Name', 'string');
                $resultEntries["lot"][$i]['totalAmount'] = $this->existNodo($procurementProjectLot[$i]['ProcurementProject']['BudgetAmount'], 'TotalAmount', 'string');
                $resultEntries["lot"][$i]['taxExclusiveAmount'] = $this->existNodo($procurementProjectLot[$i]['ProcurementProject']['BudgetAmount'], 'TaxExclusiveAmount', 'string');
                $resultEntries["lot"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
                $resultEntries["lot"][$i]['id_compuesta'] = $this->idLicitacion . "_05_" . $i;
                $resultEntries["lot"][$i]['fecha_creacion_log'] = $this->fechaInicioParser;

                if (array_key_exists("RealizedLocation", $procurementProjectLot[$i]['ProcurementProject'])) {
                    $resultEntries["lot"][$i]['countrySubentity'] = $this->existNodo($procurementProjectLot[$i]['ProcurementProject']['RealizedLocation'], 'CountrySubentity', 'string');
                    $resultEntries["lot"][$i]['countrySubentityCode'] = $this->existNodo($procurementProjectLot[$i]['ProcurementProject']['RealizedLocation'], 'CountrySubentityCode', 'string');
                    $resultEntries["lot"][$i]['identificationCode'] = $this->existNodo($procurementProjectLot[$i]['ProcurementProject']['RealizedLocation']['Address']['Country'], 'IdentificationCode', 'string');
                    $resultEntries["lot"][$i]['nameLocation'] = $this->existNodo($procurementProjectLot[$i]['ProcurementProject']['RealizedLocation']['Address']['Country'], 'Name', 'string');

                    if (array_key_exists("RequiredCommodityClassification", $procurementProjectLot[$i]['ProcurementProject'])) {
                        $clasificacionItems = $procurementProjectLot[$i]['ProcurementProject']['RequiredCommodityClassification'];
                        $firstKey = array_key_first($clasificacionItems);
                        if ($firstKey !== 0) {
                            $clasificacionItems = array(0 => $clasificacionItems);
                        }
                        for ($j = 0; $j < count($clasificacionItems); $j++) {

                            $resultEntries['itemClassification'][] = array(
                                "idItem" => $this->existNodo($clasificacionItems[$j], "ItemClassificationCode", "string"),
                                "id_ajena_licitacion" => $this->idLicitacion,
                                "id_compuesta" => $this->idLicitacion . "_05_" . $i . "_" . $j,
                                "id_compuesta_padre" => $this->idLicitacion . "_05_" . $i,
                                "fecha_creacion_log" => $this->fechaInicioParser,
                                "id_attr" => $this->existAttribute($xmlPrimitivo->ContractFolderStatus->ProcurementProjectLot->RequiredCommodityClassification, "ItemClassificationCode", "string", 'listURI'),
                            );
                        }
                    }
                }
            }
        }

        return $resultEntries;
    }

    private function nodoTenderResult($xml)
    {
        $resultEntries = array();
        if (array_key_exists("TenderResult", $xml['ContractFolderStatus'])) {
            $tenderResult = $xml['ContractFolderStatus']['TenderResult'];
            $firstKey = array_key_first($tenderResult);
            if ($firstKey !== 0) {
                $tenderResult = array(0 => $tenderResult);
            }
            for ($i = 0; $i < count($tenderResult); $i++) {
                $resultEntries[$i]['id_ajena_licitacion'] = $this->idLicitacion;
                $resultEntries[$i]['id_compuesta'] = $this->idLicitacion . "_06_" . $i;
                $resultEntries[$i]['fecha_creacion_log'] = $this->fechaInicioParser;
                $resultEntries[$i]['resultCode'] = $this->existNodo($tenderResult[$i], 'ResultCode', 'string');
                $resultEntries[$i]['description'] = $this->existNodo($tenderResult[$i], 'Description', 'string');
                $resultEntries[$i]['awardDate'] = $this->existNodo($tenderResult[$i], 'AwardDate', 'string');
                $resultEntries[$i]['receivedTenderQuantity'] = $this->existNodo($tenderResult[$i], 'ReceivedTenderQuantity', 'string');
                $resultEntries[$i]['lowerTenderAmount'] = $this->existNodo($tenderResult[$i], 'LowerTenderAmount', 'string');
                $resultEntries[$i]['higherTenderAmount'] = $this->existNodo($tenderResult[$i], 'HigherTenderAmount', 'string');
                $resultEntries[$i]['abnormallyLowTendersIndicator'] = $this->existNodo($tenderResult[$i], 'AbnormallyLowTendersIndicator', 'string');
                $resultEntries[$i]['startDate'] = $this->existNodo($tenderResult[$i], 'StartDate', 'string');
                $resultEntries[$i]['smeawardedIndicator'] = $this->existNodo($tenderResult[$i], 'SMEAwardedIndicator', 'string');
                //AwardedTenderedProject
                $resultEntries[$i]['contract_id'] = $this->existNodo($tenderResult[$i]['Contract'], 'ID', 'string');
                $resultEntries[$i]['contract_issueDate'] = $this->existNodo($tenderResult[$i]['Contract'], 'IssueDate', 'string');

                if (array_key_exists("WinningParty", $tenderResult[$i])) {
                    $winningParty = $tenderResult[$i]['WinningParty'];
                    $resultEntries[$i]['partyIdentification'] = $this->existNodo($winningParty['PartyIdentification'], 'ID', 'string');
                    $resultEntries[$i]['partyName'] = $this->existNodo($winningParty['PartyName'], 'Name', 'string');
                }
                if (array_key_exists("AwardedTenderedProject", $tenderResult[$i])) {
                    $awardedTenderedProject = $tenderResult[$i]['AwardedTenderedProject'];
                    $resultEntries[$i]['procurementProjectLotID'] = $this->existNodo($awardedTenderedProject, 'ProcurementProjectLotID', 'string');
                    $resultEntries[$i]['TaxExclusiveAmount'] = $this->existNodo($awardedTenderedProject['LegalMonetaryTotal'], 'TaxExclusiveAmount', 'string');
                    $resultEntries[$i]['PayableAmount'] = $this->existNodo($awardedTenderedProject['LegalMonetaryTotal'], 'PayableAmount', 'string');
                }
            }
        }

        //$resultFinal = $this->array_remove_empty($resultEntries);
        return $resultEntries;
    }

    private function nodoTenderingTerms($xml)
    {
        $resultEntries = array();
        if (array_key_exists("TenderingTerms", $xml['ContractFolderStatus'])) {
            $TenderingTerms = $xml['ContractFolderStatus']['TenderingTerms'];

            $resultEntries['tenderingTerm']['requiredCurriculaIndicator'] = $this->existNodo($TenderingTerms, 'RequiredCurriculaIndicator', 'string');
            $resultEntries['tenderingTerm']['variantConstraintIndicator'] = $this->existNodo($TenderingTerms, 'VariantConstraintIndicator', 'string');

            $tendererAwardingTerms = $TenderingTerms['FundingProgramCode'];
            if (is_array($tendererAwardingTerms)) {
                if (array_key_first($tendererAwardingTerms) !== 0) {
                    $tendererAwardingTerms = array(0 => $tendererAwardingTerms);
                }
                $resultEntries["tenderingTerm"]['fundingProgramCode'] = $tendererAwardingTerms[0];
                $resultEntries["tenderingTerm"]['fundingProgramCode2'] = $tendererAwardingTerms[1];
                $resultEntries['tenderingTerm']['fundingProgram'] = $this->existNodo($TenderingTerms, 'FundingProgram', 'string');
            } else {
                $resultEntries['tenderingTerm']['fundingProgramCode'] = $this->existNodo($TenderingTerms, 'FundingProgramCode', 'string');
            }



            $resultEntries['tenderingTerm']['id_ajena_licitacion'] = $this->idLicitacion;
            $resultEntries['tenderingTerm']['id_compuesta'] = $this->idLicitacion . "_07";
            $resultEntries['tenderingTerm']['fecha_creacion_log'] = $this->fechaInicioParser;

            if (array_key_exists("RequiredFinancialGuarantee", $TenderingTerms)) {
                $resultEntries['tenderingTerm']['guaranteeTypeCode'] = $this->existNodo($TenderingTerms['RequiredFinancialGuarantee'], 'GuaranteeTypeCode', 'string');
                $resultEntries['tenderingTerm']['guaranteeTypeCode_attr'] = $this->existAttribute($TenderingTerms['RequiredFinancialGuarantee'], "GuaranteeTypeCode", "string", 'listURI');
                $resultEntries['tenderingTerm']['requiredFinancialGuarantee_Amount'] = $this->existNodo($TenderingTerms['RequiredFinancialGuarantee'], 'AmountRate', 'string');
            }

            $resultEntries['tenderingTerm']['procurementLegislationDocumentReference'] = $this->existNodo($TenderingTerms['ProcurementLegislationDocumentReference'], 'ID', 'string');
            $resultEntries['tenderingTerm']['allowedSubcontractTerms'] = $this->existNodo($TenderingTerms['AllowedSubcontractTerms'], 'Description', 'string');

            //Criterio de adjudicación
            if (array_key_exists("AwardingTerms", $TenderingTerms)) {
                $tendererAwardingTerms = $TenderingTerms['AwardingTerms']['AwardingCriteria'];
                if (array_key_first($tendererAwardingTerms) !== 0) {
                    $tendererAwardingTerms = array(0 => $tendererAwardingTerms);
                }
                for ($i = 0; $i < count($tendererAwardingTerms); $i++) {
                    $resultEntries["awardingCriteria"][$i]['description'] = $this->existNodo($tendererAwardingTerms[$i], 'Description', 'string');
                    $resultEntries["awardingCriteria"][$i]['evaluationCriteriaTypeCode'] = $this->existNodo($tendererAwardingTerms[$i], 'WeightNumeric', 'string');
                    $resultEntries["awardingCriteria"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
                    $resultEntries["awardingCriteria"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
                    $resultEntries["awardingCriteria"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
                    $resultEntries['awardingCriteria'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
                }
            }

            //Criterio de evluación tecnica
            if (array_key_exists("TendererQualificationRequest", $TenderingTerms)) {
                $tendererQualificationRequest = $TenderingTerms['TendererQualificationRequest'];
                $resultEntries['tenderingTerm']['description'] = $this->existNodo($tendererQualificationRequest, 'Description', 'string');
                $resultEntries['tenderingTerm']['personalSituation'] = $this->existNodo($tendererQualificationRequest, 'PersonalSituation', 'string');
                if (isset($tendererQualificationRequest['TechnicalEvaluationCriteria'])) {
                    $techicnalQualifitacion = $tendererQualificationRequest['TechnicalEvaluationCriteria'];
                    if (array_key_first($techicnalQualifitacion) !== 0) {
                        $techicnalQualifitacion = array(0 => $techicnalQualifitacion);
                    }
                    for ($i = 0; $i < count($techicnalQualifitacion); $i++) {

                        $resultEntries["TendererQualificationRequest"][$i]['evaluationCriteriaTypeCode'] = $this->existNodo($tendererQualificationRequest['TechnicalEvaluationCriteria'][$i], 'EvaluationCriteriaTypeCode', 'string');
                        $resultEntries["TendererQualificationRequest"][$i]['evaluationCriteriaTypeCode_attr'] = $this->existAttribute($tendererQualificationRequest['TechnicalEvaluationCriteria'][$i], "EvaluationCriteriaTypeCode", "sting", 'listURI');
                        $resultEntries["TendererQualificationRequest"][$i]['description'] = $this->existNodo($tendererQualificationRequest['TechnicalEvaluationCriteria'][$i], 'Description', 'string');
                        $resultEntries["TendererQualificationRequest"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
                        $resultEntries["TendererQualificationRequest"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
                        $resultEntries["TendererQualificationRequest"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
                        $resultEntries['TendererQualificationRequest'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
                    }
                }

                //Criterios de evaluacion financiera
                if (array_key_exists("FinancialEvaluationCriteria", $TenderingTerms['TendererQualificationRequest'])) {
                    $financialEvaluationCriteria = $TenderingTerms['TendererQualificationRequest']['FinancialEvaluationCriteria'];
                    for ($i = 0; $i < count($financialEvaluationCriteria); $i++) {
                        $resultEntries["FinancialEvaluationCriteria"][$i]['evaluationCriteriaTypeCode'] = $this->existNodo($financialEvaluationCriteria[$i], 'EvaluationCriteriaTypeCode', 'string');
                        $resultEntries["FinancialEvaluationCriteria"][$i]['evaluationCriteriaTypeCode_attr'] = $this->existAttribute($financialEvaluationCriteria[$i], "EvaluationCriteriaTypeCode", "string", 'listURI');
                        $resultEntries["FinancialEvaluationCriteria"][$i]['description'] = $this->existNodo($financialEvaluationCriteria[$i], 'Description', 'string');
                        $resultEntries["FinancialEvaluationCriteria"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
                        $resultEntries["FinancialEvaluationCriteria"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
                        $resultEntries["FinancialEvaluationCriteria"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
                        $resultEntries['FinancialEvaluationCriteria'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
                    }
                }

                //Requisitos de participación
                if (array_key_exists("SpecificTendererRequirement", $TenderingTerms['TendererQualificationRequest'])) {
                    $specificTendererRequirement = $TenderingTerms['TendererQualificationRequest']['SpecificTendererRequirement'];
                    if (array_key_first($specificTendererRequirement) !== 0) {
                        $specificTendererRequirement = array(0 => $specificTendererRequirement);
                    }
                    for ($i = 0; $i < count($specificTendererRequirement); $i++) {

                        $resultEntries["SpecificTendererRequirement"][$i]['evaluationCriteriaTypeCode'] = $this->existNodo($specificTendererRequirement[$i], 'RequirementTypeCode', 'string');
                        $resultEntries["SpecificTendererRequirement"][$i]['evaluationCriteriaTypeCode_attr'] = $this->existAttribute($specificTendererRequirement[$i], "RequirementTypeCode", "string", 'listURI');
                        $resultEntries["SpecificTendererRequirement"][$i]['id_ajena_licitacion'] = $this->idLicitacion;
                        $resultEntries["SpecificTendererRequirement"][$i]['id_compuesta'] = $this->idLicitacion . "_07_" . $i;
                        $resultEntries["SpecificTendererRequirement"][$i]['id_compuesta_padre'] = $this->idLicitacion . "_07";
                        $resultEntries['SpecificTendererRequirement'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;
                    }
                }
            }

            $resultEntries["tenderingTerm"]['language'] = $this->existNodo($TenderingTerms['Language'], 'ID', 'string');
        }

        return $resultEntries;
    }

    private function nodoTenderingProcess($xml)
    {
        $resultEntries = array();
        if (array_key_exists("TenderingProcess", $xml['ContractFolderStatus'])) {
            $tenderingProcess = $xml['ContractFolderStatus']['TenderingProcess'];

            //TenderingProcess
            $resultEntries['procedureCode'] = $this->existNodo($tenderingProcess, 'ProcedureCode', 'string');
            $resultEntries['procedureCode_attr'] = $this->existAttribute($tenderingProcess, "ProcedureCode", "string", 'listURI');

            $resultEntries['urgencyCode'] = $this->existNodo($tenderingProcess, 'UrgencyCode', 'string');
            $resultEntries['urgencyCode_attr'] = $this->existAttribute($tenderingProcess, "UrgencyCode", "string", 'listURI');

            $resultEntries['contractingSystemCode'] = $this->existNodo($tenderingProcess, 'ContractingSystemCode', 'string');
            $resultEntries['contractingSystemCode_attr'] = $this->existAttribute($tenderingProcess, "ContractingSystemCode", "string", 'listURI');

            $resultEntries['partPresentationCode'] = $this->existNodo($tenderingProcess, 'PartPresentationCode', 'string');
            $resultEntries['partPresentationCode_attr'] = $this->existAttribute($tenderingProcess, "PartPresentationCode", "string", 'listURI');

            $resultEntries['submissionMethodCode'] = $this->existNodo($tenderingProcess, 'SubmissionMethodCode', 'string');
            $resultEntries['submissionMethodCode_attr'] = $this->existAttribute($tenderingProcess, "SubmissionMethodCode", "string", 'listURI');

            $resultEntries['maximumLotPresentationQuantity'] = $this->existNodo($tenderingProcess, 'MaximumLotPresentationQuantity', 'string');
            $resultEntries['maximumTendererAwardedLotsQuantity'] = $this->existNodo($tenderingProcess, 'MaximumTendererAwardedLotsQuantity', 'string');
            $resultEntries['deadLineEndDate'] = $this->existNodo($tenderingProcess['TenderSubmissionDeadlinePeriod'], 'EndDate', 'string');
            $resultEntries['deadLineEndTime'] = $this->existNodo($tenderingProcess['TenderSubmissionDeadlinePeriod'], 'EndTime', 'string');
            $resultEntries['deadLineDescription'] = $this->existNodo($tenderingProcess['TenderSubmissionDeadlinePeriod'], 'Description', 'string');
            $resultEntries['auctionTerms'] = $this->existNodo($tenderingProcess['AuctionTerms'], 'AuctionConstraintIndicator', 'string');
            $resultEntries['LotsCombinationContractingAuthorityRights'] = $this->existNodo($tenderingProcess, 'LotsCombinationContractingAuthorityRights', 'string');
            $resultEntries['documentAvailablePeriod_EndDate'] = $this->existNodo($tenderingProcess['DocumentAvailabilityPeriod'], 'EndDate', 'string');
            $resultEntries['documentAvailablePeriod_EndTime'] = $this->existNodo($tenderingProcess['DocumentAvailabilityPeriod'], 'EndTime', 'string');
            $resultEntries['id_ajena_licitacion'] = $this->idLicitacion;
            $resultEntries['id_compuesta'] = $this->idLicitacion . "_08";
            $resultEntries['fecha_creacion_log'] = $this->fechaInicioParser;
        }
        return $resultEntries;
    }

    private function nodoLegalDoc($xml)
    {
        $resultEntries = array();
        if (array_key_exists("LegalDocumentReference", $xml['ContractFolderStatus'])) {
            $legalDocumentReference = $xml['ContractFolderStatus']['LegalDocumentReference'];

            $resultEntries['idDoc'] = $this->existNodo($legalDocumentReference, 'ID', 'string');
            $resultEntries['attachment'] = $this->existNodo($legalDocumentReference['Attachment']['ExternalReference'], 'URI', 'string');
            $resultEntries['documentHash'] = $this->existNodo($legalDocumentReference['Attachment']['ExternalReference'], 'DocumentHash', 'string');
            $resultEntries['id_ajena_licitacion'] = $this->idLicitacion;
            $resultEntries['id_compuesta'] = $this->idLicitacion . "_09";
            $resultEntries['fecha_creacion_log'] = $this->fechaInicioParser;

            return $resultEntries;
        }
        //$resultFinal = $this->checkArrayValuesEmpty($resultEntries);
        //return $this->idLicitacion;
    }

    private function nodoTechnicalDocumentReference($xml)
    {
        $resultEntries = array();
        if (array_key_exists("TechnicalDocumentReference", $xml['ContractFolderStatus'])) {
            $technicalDocumentReference = $xml['ContractFolderStatus']['TechnicalDocumentReference'];
            $resultEntries['idDoc'] = $this->existNodo($technicalDocumentReference, 'ID', 'string');
            $resultEntries['attachment'] = $this->existNodo($technicalDocumentReference['Attachment']['ExternalReference'], 'URI', 'string');
            $resultEntries['documentHash'] = $this->existNodo($technicalDocumentReference['Attachment']['ExternalReference'], 'DocumentHash', 'string');
            $resultEntries['id_ajena_licitacion'] = $this->idLicitacion;
            $resultEntries['id_compuesta'] = $this->idLicitacion . "_10";
            $resultEntries['fecha_creacion_log'] = $this->fechaInicioParser;

            return $resultEntries;
        }
        //$resultFinal = $this->checkArrayValuesEmpty($resultEntries);
        //return $this->idLicitacion;
    }

    private function nodoAdditionalDocumentReference($xml)
    {
        $resultEntries = array();
        if (array_key_exists("AdditionalDocumentReference", $xml['ContractFolderStatus'])) {
            $additionalDocumentReference = $xml['ContractFolderStatus']['AdditionalDocumentReference'];
            if (array_key_first($additionalDocumentReference) !== 0) {
                $additionalDocumentReference = array(0 => $additionalDocumentReference);
            }
            for ($i = 0; $i < count($additionalDocumentReference); $i++) {
                $resultEntries[$i]['idDoc'] = $this->existNodo($additionalDocumentReference[$i], 'ID', 'string');
                $resultEntries[$i]['attachment'] = $this->existNodo($additionalDocumentReference[$i]['Attachment']['ExternalReference'], 'URI', 'string');
                $resultEntries[$i]['documentHash'] = $this->existNodo($additionalDocumentReference[$i]['Attachment']['ExternalReference'], 'DocumentHash', 'string');
                $resultEntries[$i]['id_ajena_licitacion'] = $this->idLicitacion;
                $resultEntries[$i]['id_compuesta'] = $this->idLicitacion . "_11_" . $i;
                $resultEntries[$i]['fecha_creacion_log'] = $this->fechaInicioParser;
            }
            return $resultEntries;
        }
        //$resultFinal = $this->checkArrayValuesEmpty($resultEntries);
        //return $this->idLicitacion;
    }

    private function nodoGeneralDocuments($xml)
    {
        $resultEntries = array();
        if (array_key_exists("GeneralDocument", $xml['ContractFolderStatus'])) {
            $generalDocument = $xml['ContractFolderStatus']['GeneralDocument'];

            if (array_key_first($generalDocument) !== 0) {
                $generalDocument = array(0 => $generalDocument);
            }
            for ($i = 0; $i < count($generalDocument); $i++) {
                $resultEntries[$i]['idDoc'] = $this->existNodo($generalDocument[$i]['GeneralDocumentDocumentReference'], 'ID', 'string');
                $resultEntries[$i]['attachment'] = $this->existNodo($generalDocument[$i]['GeneralDocumentDocumentReference']['Attachment']['ExternalReference'], 'URI', 'string');
                $resultEntries[$i]['fileName'] = $this->existNodo($generalDocument[$i]['GeneralDocumentDocumentReference']['Attachment']['ExternalReference'], 'FileName', 'string');
                $resultEntries[$i]['id_ajena_licitacion'] = $this->idLicitacion;
                $resultEntries[$i]['id_compuesta'] = $this->idLicitacion . "_13_" . $i;
                $resultEntries[$i]['fecha_creacion_log'] = $this->fechaInicioParser;
            }
            return $resultEntries;
        }
        //return $this->idLicitacion;
    }

    private function nodoValidNoticeInfo($xml)
    {
        $resultEntries = array();
        $additionalPublicationDocument = array();
        $AdditionalPublicationStatus = array();
        $validNoticeInfo = array();
        if (array_key_exists("ValidNoticeInfo", $xml['ContractFolderStatus'])) {
            $validNoticeInfo = $xml['ContractFolderStatus']['ValidNoticeInfo'];
            $firstKey = array_key_first($validNoticeInfo);
            if ($firstKey !== 0) {
                $validNoticeInfo = array(0 => $validNoticeInfo);
            }
            for ($i = 0; $i < count($validNoticeInfo); $i++) {
                $resultEntries['noticeInfo'][$i]['noticeTypeCode'] = $this->existNodo($validNoticeInfo[$i], 'NoticeTypeCode', 'string');
                $resultEntries['noticeInfo'][$i]['id_ajena_licitacion'] = $this->idLicitacion;
                $resultEntries['noticeInfo'][$i]['id_compuesta'] = $this->idLicitacion . "_12_" . $i;
                $resultEntries['noticeInfo'][$i]['fecha_creacion_log'] = $this->fechaInicioParser;

                if (array_key_exists("AdditionalPublicationStatus", $validNoticeInfo[$i])) {
                    $AdditionalPublicationStatus = $validNoticeInfo[$i]['AdditionalPublicationStatus'];

                    $firstKey = array_key_first($AdditionalPublicationStatus);
                    if ($firstKey !== 0) {
                        $AdditionalPublicationStatus = array(0 => $AdditionalPublicationStatus);
                    }

                    for ($j = 0; $j < count($AdditionalPublicationStatus); $j++) {
                        $resultEntries['noticeInfo'][$i]['publicationMediaName'] = $this->existNodo($AdditionalPublicationStatus[$j], 'PublicationMediaName', 'string');

                        if (array_key_exists("AdditionalPublicationDocumentReference", $AdditionalPublicationStatus[$j])) {
                            $additionalPublicationDocument = $AdditionalPublicationStatus[$j]["AdditionalPublicationDocumentReference"];
                            if (array_key_first($additionalPublicationDocument) !== 0) {
                                $additionalPublicationDocument = array(0 => $additionalPublicationDocument);
                            }
                            for ($x = 0; $x < count($additionalPublicationDocument); $x++) {

                                if (array_key_exists("IssueDate", $additionalPublicationDocument[$x])) {
                                    $resultEntries['fechas'][$x]['fechas'] = $this->existNodo($additionalPublicationDocument[$x], 'IssueDate', 'string');
                                    $resultEntries['fechas'][$x]['id_ajena_licitacion'] = $this->idLicitacion;
                                    $resultEntries['fechas'][$x]['id_compuesta'] = $this->idLicitacion . "_12_" . $i . "_" . $j . "_" . $x;
                                    $resultEntries['fechas'][$x]['id_compuesta_padre'] = $this->idLicitacion . "_12_" . $i;
                                    $resultEntries['fechas'][$x]['fecha_creacion_log'] = $this->fechaInicioParser;
                                }

                                if (array_key_exists("DocumentTypeCode", $additionalPublicationDocument[$x])) {

                                    $resultEntries['documento'][$x]['documento'] = $this->existNodo($additionalPublicationDocument[$x]['Attachment']['ExternalReference'], 'URI', 'string');
                                    $resultEntries['documento'][$x]['filename'] = $this->existNodo($additionalPublicationDocument[$x]['Attachment']['ExternalReference'], 'FileName', 'string');
                                    $resultEntries['documento'][$x]['id_ajena_licitacion'] = $this->idLicitacion;
                                    $resultEntries['documento'][$x]['id_compuesta'] = $this->idLicitacion . "_12_" . $i . "_" . $j . "_" . $x;
                                    $resultEntries['documento'][$x]['id_compuesta_padre'] = $this->idLicitacion . "_12_" . $i;
                                    $resultEntries['documento'][$x]['fecha_creacion_log'] = $this->fechaInicioParser;
                                }
                            }
                        }
                        unset($additionalPublicationDocument);
                    }
                }
            }
        }

        unset($AdditionalPublicationStatus);
        unset($validNoticeInfo);
        return $resultEntries;
    }

    private function existNodo($nodo, $nodoHijo, $tipo)
    {

        if (isset($nodo) && @count($nodo) > 0) {
            return $this->switchTipo($tipo, $nodo[$nodoHijo]);
        } else {
            return "";
        }
    }

    private function existAttribute($nodo, $nodoHijo, $tipo, $nombreAttributo)
    {
        $nodoFinal = $nodo->{$nodoHijo};
        if (isset($nodoFinal) && !empty($nodoFinal)) {
            //if (@count($nodo->{$nodoHijo}) > 0) {
            return $this->switchTipoAttribute($tipo, $nodo->{$nodoHijo}, $nombreAttributo);
            //}
        } else {
            return "";
        }
    }

    private function switchTipo($tipo, $nodo)
    {
        switch ($tipo) {
            case 'string':
                return (string) $nodo;
                break;
            case 'int':
                return (int) $nodo;
                break;
            case 'array':
                return (array) $nodo;
                break;
        }
    }

    private function switchTipoAttribute($tipo, $nodo, $attributo)
    {
        switch ($tipo) {
            case 'string':
                return (string) $nodo->attributes()[$attributo];
                break;
        }
    }
}

/* End of file ParserFile.php */
/* Location: ./application/libraries/ParserFile.php */
