XML <List>

@return void
164382
private function listEndHandler(): void
    {
        $this->process_repeats--;
        if ($this->process_repeats > 0) {
            return;
        }

        // Check if there is any list
        if (count($this->list) > 0) {
            $lineoffset = 0;
            foreach ($this->repeats_stack as $rep) {
                $lineoffset += $rep[1];
            }
            //-- read the xml from the file
            $lines = file($this->report);
            while ((strpos($lines[$lineoffset + $this->repeat_bytes], '<List') === false) && (($lineoffset + $this->repeat_bytes) > 0)) {
                $lineoffset--;
            }
            $lineoffset++;
            $reportxml = "<tempdoc>\n";
            $line_nr   = $lineoffset + $this->repeat_bytes;
            // List Level counter
            $count = 1;
            while (0 < $count) {
                if (strpos($lines[$line_nr], '<List') !== false) {
                    $count++;
                } elseif (strpos($lines[$line_nr], '</List') !== false) {
                    $count--;
                }
                if (0 < $count) {
                    $reportxml .= $lines[$line_nr];
                }
                $line_nr++;
            }
            // No need to drag this
            unset($lines);
            $reportxml .= '</tempdoc>';
            // Save original values
            $this->parser_stack[] = $this->parser;
            $oldgedrec            = $this->gedrec;

            $this->list_total   = count($this->list);
            $this->list_private = 0;
            foreach ($this->list as $record) {
                if ($record->canShow()) {
                    $this->gedrec = $record->privatizeGedcom(Auth::accessLevel($record->tree()));
                    //-- start the sax parser
                    $repeat_parser = xml_parser_create();
                    $this->parser  = $repeat_parser;
                    xml_parser_set_option($repeat_parser, XML_OPTION_CASE_FOLDING, false);

                    xml_set_element_handler(
                        $repeat_parser,
                        function ($parser, string $name, array $attrs): void {
                            $this->startElement($parser, $name, $attrs);
                        },
                        function ($parser, string $name): void {
                            $this->endElement($parser, $name);
                        }
                    );

                    xml_set_character_data_handler(
                        $repeat_parser,
                        function ($parser, string $data): void {
                            $this->characterData($parser, $data);
                        }
                    );

                    if (!xml_parse($repeat_parser, $reportxml, true)) {
                        throw new DomainException(sprintf(
                            'ListEHandler XML error: %s at line %d',
                            xml_error_string(xml_get_error_code($repeat_parser)),
                            xml_get_current_line_number($repeat_parser)
                        ));
                    }
                    xml_parser_free($repeat_parser);
                } else {
                    $this->list_private++;
                }
            }
            $this->list   = [];
            $this->parser = array_pop($this->parser_stack);
            $this->gedrec = $oldgedrec;
        }
        [$this->repeats, $this->repeat_bytes] = array_pop($this->repeats_stack);
    }
739994
public function listAll() {
        $tree = Globals::getTree();
        $controller = new PageController();
        $controller
            ->setPageTitle(I18N::translate('Certificates'))
            ->restrictAccess(
                $this->module->getSetting('MAJ_SHOW_CERT', Auth::PRIV_HIDE) >= Auth::accessLevel($tree)
            );
        
        $city = Filter::get('city');
        
        if(!empty($city) && strlen($city) > 22){
            $city = Functions::decryptFromSafeBase64($city);
            $controller->setPageTitle(I18N::translate('Certificates for %s', $city));
        }
        
        $data = new ViewBag();
        $data->set('title', $controller->getPageTitle());
        $data->set('url_module', $this->module->getName());
        $data->set('url_action', '');
        $data->set('url_ged', $tree->getNameUrl());
        
        $data->set('cities', $this->provider->getCitiesList());
        $data->set('selected_city', $city);
        
        $data->set('has_list', false);        
        if(!empty($city)) {            
            $table_id = 'table-certiflist-' . Uuid::uuid4();
            
            $certif_list = $this->provider->getCertificatesList($city);            
            if(!empty($certif_list)) {                
                $data->set('has_list', true);
                $data->set('table_id', $table_id);
                $data->set('certificate_list', $certif_list);
                
                $controller
                    ->addExternalJavascript(WT_JQUERY_DATATABLES_JS_URL)
                    ->addInlineJavascript('
				        jQuery.fn.dataTableExt.oSort["text-asc"] = textCompareAsc;
				        jQuery.fn.dataTableExt.oSort["text-desc"] = textCompareDesc;
                        
                        jQuery("#'.$table_id.'").dataTable( {
        					dom: \'<"H"<"filtersH_' . $table_id . '">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_' . $table_id . '">>\',
    					    '.I18N::datatablesI18N().',
    					    jQueryUI: true,
        					autoWidth: false,
        					processing: true,
        					columns: [
        		                    /* 0-Date */  			{ type: "num", width: "15%", class: "center" },
        		                    /* 1-Type */ 			{ type: "text", width: "5%", searchable: false, class: "center"},
        		                    /* 2-Certificate */     { type: "text", class: "left" }
        		                ],
        		            sorting: [[0,"asc"], [1,"asc"]],
        					displayLength: 20,
        					pagingType: "full_numbers"
        			   });
        				jQuery(".certificate-list").css("visibility", "visible");
        				jQuery(".loading-image").css("display", "none");
                    ');
            }
        }
        
        ViewFactory::make('CertificatesList', $this, $controller, $data)->render();
        
    }
217426
private function generateList($caption, $paragraph, $filelist, $xslUsed, $xsl)
	{
		$paragraph->addXmlnukeObject(new XmlnukeText($caption,true));
				
		$listCollection = new XmlListCollection(XmlListType::UnorderedList );
		$paragraph->addXmlnukeObject($listCollection);
			
		foreach($filelist as $file)
		{
			$xslname = FileUtil::ExtractFileName($file);
			$xslname = $xsl->removeLanguage($xslname);
			if(!in_array ($xslname, $xslUsed))				
			{
				$objectList = new XmlnukeSpanCollection();
				$listCollection->addXmlnukeObject($objectList);
			
				$xslUsed[] = $xslname;					
				if ($xslname == "index")
				{
					$anchor = new XmlAnchorCollection("engine:xmlnuke?xml=index&xsl=index");
					$anchor->addXmlnukeObject(new XmlnukeText($xslname,true));
					$objectList->addXmlnukeObject($anchor);
				}
				else
				{
					$anchor = new XmlAnchorCollection("module:Xmlnuke.XSLTheme?xsl=" . $xslname);
					$anchor->addXmlnukeObject(new XmlnukeText($xslname,true));
					$objectList->addXmlnukeObject($anchor);
				}
			}
		}
	}
97682
public function xmlClassAttributeIds()
    {
        if ( $this->xmlClassAttributeIdArray === null )
        {
            // First we want to find all class attributes which are defined. We won't be touching
            // attributes which are in a transient state.
            $xmlTextAttributes = eZContentClassAttribute::fetchList( true, array( 'data_type' => 'ezxmltext',
                                                                                  'version' => 0 ) );
            $this->xmlClassAttributeIdArray = array();

            foreach ( $xmlTextAttributes as $classAttr )
            {
                $this->xmlClassAttributeIdArray[] = $classAttr->attribute( 'id' );
            }
            unset( $xmlTextAttributes );
        }
        return $this->xmlClassAttributeIdArray;
    }
430332
private function buildListItens($list, $arr)
	{
		foreach ($arr as $key=>$value) 
		{
			$item = XmlUtil::CreateChild($list, "item", "");
			XmlUtil::AddAttribute($item, "id", $key);
			XmlUtil::AddAttribute($item, "text", $value);
		}
	}
297509
protected function setActionTags()
    {
        $form = $this->xml->getElementsByTagName('form')->item(0);
        $div = $this->xml->createElement('div');

        $input = $this->xml->createElement('input');
        $input->setAttribute('type', 'hidden');
        $input->setAttribute('name', 'ext');
        $input->setAttribute('value', $this->owner->name);
        $div->appendChild($input);

        $input = $this->xml->createElement('input');
        $input->setAttribute('type', 'hidden');
        $input->setAttribute('name', 'form');
        $input->setAttribute('value', $this->name);
        $div->appendChild($input);

        $form->appendChild($div);
    }
737773
def setListDoc(self, list):
        
        if list is None: list__o = None
        else: list__o = list._o
        libxml2mod.xmlSetListDoc(list__o, self._o)
349622
public function xml2json(): void
    {
        $xml = simplexml_load_string($this->xmlData, NULL, LIBXML_NOCDATA);
        $this->jsonData = json_encode($xml);
    }
1037553
public function toXml()
    {
        $messages = '';
        /** @var ShortMessage $shortMessage */
        foreach ($this->items as $shortMessage) {
            $messages .= $shortMessage->toMultipleMessagesXml();
        }

        return $messages;
    }
762871
public function xml()
    {
        if (empty($this->_result)) {
            return $this->xml->getSimpleXmlElement();
        }
        $hideRaids = array();
        if (defined('PSI_PLUGIN_RAID_HIDE_DEVICES') && is_string(PSI_PLUGIN_RAID_HIDE_DEVICES)) {
            if (preg_match(ARRAY_EXP, PSI_PLUGIN_RAID_HIDE_DEVICES)) {
                $hideRaids = eval(PSI_PLUGIN_RAID_HIDE_DEVICES);
            } else {
                $hideRaids = array(PSI_PLUGIN_RAID_HIDE_DEVICES);
            }
        }
        foreach ($this->_result['devices'] as $key=>$device) {
            if (!in_array(ltrim($key, "/"), $hideRaids, true)) {
                $dev = $this->xml->addChild("Raid");
                $dev->addAttribute("Device_Name", ltrim($key, "/")); //for megactl and megasasctl conflicts
                $dev->addAttribute("Program", $device["prog"]);
                if (isset($device['level'])) $dev->addAttribute("Level", strtolower($device["level"]));
                $dev->addAttribute("Status", strtolower($device["status"]));
                if (isset($device['name'])) $dev->addAttribute("Name", $device["name"]);
                if (isset($device['size'])) $dev->addAttribute("Size", $device["size"]);
                if (isset($device['stride'])) $dev->addAttribute("Stride", $device["stride"]);
                if (isset($device['subsets'])) $dev->addAttribute("Subsets", $device["subsets"]);
                if (isset($device['devs'])) $dev->addAttribute("Devs", $device["devs"]);
                if (isset($device['spares'])) $dev->addAttribute("Spares", $device["spares"]);

                if (isset($device['chunk_size'])) $dev->addAttribute("Chunk_Size", $device["chunk_size"]);
                if (isset($device['pers_superblock'])) $dev->addAttribute("Persistend_Superblock", $device["pers_superblock"]);
                if (isset($device['algorithm'])) $dev->addAttribute("Algorithm", $device["algorithm"]);
                if (isset($device['registered'])) $dev->addAttribute("Disks_Registered", $device["registered"]);
                if (isset($device['active'])) $dev->addAttribute("Disks_Active", $device["active"]);
                if (isset($device['controller'])) $dev->addAttribute("Controller", $device["controller"]);
                if (isset($device['battery'])) $dev->addAttribute("Battery", $device["battery"]);
                if (isset($device['supported'])) $dev->addAttribute("Supported", $device["supported"]);
                if (isset($device['readpolicy'])) $dev->addAttribute("ReadPolicy", $device["readpolicy"]);
                if (isset($device['writepolicy'])) $dev->addAttribute("WritePolicy", $device["writepolicy"]);
                if (isset($device['cache_size'])) $dev->addAttribute("Cache_Size", $device["cache_size"]);
                if (isset($device['bad_blocks'])) $dev->addAttribute("Bad_Blocks", $device["bad_blocks"]);

                if (isset($device['action'])) {
                    $action = $dev->addChild("Action");
                    $action->addAttribute("Name", $device['action']['name']);
                    if (isset($device['action']['percent'])) $action->addAttribute("Percent", $device['action']['percent']);

                    if (isset($device['action']['finish_time'])) $action->addAttribute("Time_To_Finish", $device['action']['finish_time']);
                    if (isset($device['action']['finish_unit'])) $action->addAttribute("Time_Unit", $device['action']['finish_unit']);

                }
                $disks = $dev->addChild("RaidItems");
                if (isset($device['items']) && (sizeof($device['items'])>0)) foreach ($device['items'] as $disk) {
                    if (isset($disk['name'])) {
                        $disktemp = $disks->addChild("Item");
                        $disktemp->addAttribute("Name", $disk['name']);
                        // if (isset($disk['raid_index'])) $disktemp->addAttribute("Index", $disk['raid_index']);
                        if (isset($disk['parentid'])) $disktemp->addAttribute("ParentID", $disk['parentid']);
                        if (isset($disk['type'])) $disktemp->addAttribute("Type", $disk['type']);
                        // if (in_array(strtolower($device["status"]), array('ok', 'optimal', 'active', 'online', 'degraded'))) {
                            $disktemp->addAttribute("Status", $disk['status']);
                        //} else {
                        //    $disktemp->addAttribute("Status", "W");
                        //}
                        if (isset($disk['info'])) $disktemp->addAttribute("Info", $disk['info']);
                    }
                }
            }
        }

        return $this->xml->getSimpleXmlElement();
    }
278162
public function verifyListIsEmpty(): void
    {
        $firstRowValue = $this->adminLists['Content items']->table->getCellValue(1, 1);

        if (
        !($this->adminLists['Content items']->table->getItemCount() === 1 &&
            strpos($firstRowValue, 'No content items.') !== false)
        ) {
            throw new \Exception('"Content items" list is not empty.');
        }
    }
522642
static protected function parseResponse( $xml ){
		$list		= array();
		$response	= XML_ElementReader::read( $xml );
		foreach( $response->params as $params )
			foreach( $params as $param )
				foreach( $param as $value )
					foreach( $value as $node )
						$list[]	= self::decodeXmlParameter( $node );
		return $list;
	}
402553
public function getListsList()
    {
        $return = "";
        $list = $this->Lists()->column("Title");

        $this->extend("updateListsList", $tags);

        return implode(
            $this->config()->list_seperator,
            $list
        );
    }
1124742
private function startList()
    {
        $this->depth++;

        $values = $this->result->createElement('values');

        // set the key, if applicable
        if (null !== ($key = $this->key())) {
            $values->setAttribute('key', $key);
        }

        $this->current->appendChild($values);

        $this->references[] = $this->current;
        $this->current = $values;
    }
858478
protected function parse(): void
    {
        // add the root node
        $this->root = new HtmlNode('root');
        $activeNode = $this->root;
        while ( ! is_null($activeNode)) {
            $str = $this->content->copyUntil('<');
            if ($str == '') {
                $info = $this->parseTag();
                if ( ! $info['status']) {
                    // we are done here
                    $activeNode = null;
                    continue;
                }

                // check if it was a closing tag
                if ($info['closing']) {
                    $foundOpeningTag  = true;
                    $originalNode     = $activeNode;
                    while ($activeNode->getTag()->name() != $info['tag']) {
                        $activeNode = $activeNode->getParent();
                        if (is_null($activeNode)) {
                            // we could not find opening tag
                            $activeNode = $originalNode;
                            $foundOpeningTag = false;
                            break;
                        }
                    }
                    if ($foundOpeningTag) {
                        $activeNode = $activeNode->getParent();
                    }
                    continue;
                }

                if ( ! isset($info['node'])) {
                    continue;
                }

                /** @var AbstractNode $node */
                $node = $info['node'];
                $activeNode->addChild($node);

                // check if node is self closing
                if ( ! $node->getTag()->isSelfClosing()) {
                    $activeNode = $node;
                }
            } else if ($this->options->whitespaceTextNode ||
                trim($str) != ''
            ) {
                // we found text we care about
                $textNode = new TextNode($str, $this->options->removeDoubleSpace);
                $activeNode->addChild($textNode);
            }
        }
    }
665031
public function output_edit_lists() {
        global $OUTPUT;

        echo $OUTPUT->heading_with_help(get_string('editcategories', 'question'), 'editcategories', 'question');

        foreach ($this->editlists as $context => $list){
            $listhtml = $list->to_html(0, array('str'=>$this->str));
            if ($listhtml){
                echo $OUTPUT->box_start('boxwidthwide boxaligncenter generalbox questioncategories contextlevel' . $list->context->contextlevel);
                $fullcontext = context::instance_by_id($context);
                echo $OUTPUT->heading(get_string('questioncatsfor', 'question', $fullcontext->get_context_name()), 3);
                echo $listhtml;
                echo $OUTPUT->box_end();
            }
        }
        echo $list->display_page_numbers();
     }
623973
public function getLists () {
		// Query Sharepoint for full listing of it's lists.
		$rawXml = '';
		try {
			$rawXml = $this->soapClient->GetListCollection()->GetListCollectionResult->any;
		} catch (\SoapFault $fault) {
			$this->onError($fault);
		}

		// Load XML in to DOM document and grab all list items.
		$nodes = $this->getArrayFromElementsByTagName($rawXml, 'List');

		// Format data in to array or object
		foreach ($nodes as $counter => $node) {
			foreach ($node->attributes as $attribute => $value) {
				$idx = ($this->lower_case_indexs) ? strtolower($attribute) : $attribute;
				$results[$counter][$idx] = $node->getAttribute($attribute);
			}

			// Make object if needed
			if ($this->returnType === 1) {
				settype($results[$counter], 'object');
			}
		}

		// Add error array if stuff goes wrong.
		if (!isset($results)) {
			$results = array('warning' => 'No data returned.');
		}

		return $results;
	}