forked from daniel-luna-gonzalez/cfdiclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prueba.php
47 lines (36 loc) · 1.01 KB
/
prueba.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
require_once 'Transaction/Read_factura_cliente.php';
require_once 'DAO/Carga_factura_cliente.php';
$ScriptsPath = (__DIR__);
if(file_exists("$ScriptsPath/Config/cfdv32.xsd"))
echo "Existe el xsd";
$estado=FALSE;
$read = new Read_factura_cliente();
$xml = new DOMDocument();
$xml->load($ScriptsPath.'/_root/cfdia0000000008.xml');
if ($read->validacion_estructura($ScriptsPath.'/_root/cfdia0000000008.xml'))
{
$estado=TRUE;
echo "<p>Válido</p>";
}
else
echo "<p>inválido</p>";
$xml = simplexml_load_file($ScriptsPath.'/_root/cfdia0000000008.xml');
$array = $read->detalle("$ScriptsPath/_root/", "cfdia0000000008.xml");
//var_dump($array);
$Full = '';
$full = GetNodes($array, $Full);
echo $full;
function GetNodes($array,$Full)
{
foreach ($array as $value)
{
if(is_array($value))
{
$Full = GetNodes($value,$Full);
}
else
$Full.=$value.", ";
}
return $Full;
}