public function loadSegmentsXml(string $segment_xml_file): array
    {
        $segments_xml = \file_get_contents($segment_xml_file);

        $xml = \simplexml_load_string($segments_xml);
        unset($segments_xml);
        $this->segments = [];

        /* @var \SimpleXMLElement $segmentNode */
        foreach ($xml as $segmentNode) {
            $qualifier = (string)$segmentNode->attributes()->id;
            $segment = [];
            $segment["attributes"] = $this->readAttributesArray($segmentNode);
            $details = $this->readXmlNodes($segmentNode);
            if (!empty($details)) {
                $segment["details"] = $details;
            }
            $this->segments[$qualifier] = $segment;
        }

        return $this->segments;
    }
public function loadSegmentsXml(string $segment_xml_file): array
    {
        $segments_xml = \file_get_contents($segment_xml_file);

        $xml = \simplexml_load_string($segments_xml);
        unset($segments_xml);
        $this->segments = [];

        /* @var \SimpleXMLElement $segmentNode */
        foreach ($xml as $segmentNode) {
            $qualifier = (string)$segmentNode->attributes()->id;
            $segment = [];
            $segment["attributes"] = $this->readAttributesArray($segmentNode);
            $details = $this->readXmlNodes($segmentNode);
            if (!empty($details)) {
                $segment["details"] = $details;
            }
            $this->segments[$qualifier] = $segment;
        }

        return $this->segments;
    }
public function loadSegmentsXml ( string $ segment_xml_file ) : array { $ segments_xml = \ file_get_contents ( $ segment_xml_file ) ; $ xml = \ simplexml_load_string ( $ segments_xml ) ; unset ( $ segments_xml ) ; $ this -> segments = [ ] ; /* @var \SimpleXMLElement $segmentNode */ foreach ( $ xml as $ segmentNode ) { $ qualifier = ( string ) $ segmentNode -> attributes ( ) -> id ; $ segment = [ ] ; $ segment [ "attributes" ] = $ this -> readAttributesArray ( $ segmentNode ) ; $ details = $ this -> readXmlNodes ( $ segmentNode ) ; if ( ! empty ( $ details ) ) { $ segment [ "details" ] = $ details ; } $ this -> segments [ $ qualifier ] = $ segment ; } return $ this -> segments ; }
convert segment definition from XML to array. Sequence of data_elements and
composite_data_element same as in XML

@param string $segment_xml_file

@return array
convert segment definition from XML to array . Sequence of data_elements and composite_data_element same as in XML