PHP code example of yordanny90 / bigxml
1. Go to this page and download the library: Download yordanny90/bigxml library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yordanny90 / bigxml example snippets
$file='ruta del archivo .xml';
$xml=new \BigXML\File($file);
$reader=$xml->getReader('main/ruta/del/nodo');
if($reader){
foreach($reader AS $index=>$valor){
// Aquí el uso para cada nodo en la ruta encontrada
}
}
$file='ruta del archivo .xml';
$xml=new \BigXML\File($file);
// Recorrido rápido del XML para comprobar que no existan errores de sintaxis
$valid=$xml->validXML();
// Mapa (array) de la estructura completa del XML con un conteo de nodos
$map=$xml->makeMap();
// Lista de todas las rutas posibles
$mapList=$xml->makeMapList();