4
I have a file upload system that when sending the xml file it sends the insertions and updates in the database, but if a file with the different structure is sent I get errors. I have already found some solutions using DTD and xml schemas, but still I am a little confused since the examples do not use the same file structure as I get.
How can I ensure that the uploaded file really has the desired structure using php and mysql?
Following is an example of the xml file:
<?xml version="1.0"?>
<table>
<row>
<column>
131290444
</column>
<column>
Nome Completo
</column>
<column>
10/09/1991
</column>
<column>
39077161830
</column>
<column>
[email protected]
</column>
<column>
Aluno Regularmente Matriculado
</column>
</row>
<row>
<column>
151290202
</column>
<column>
Nome completo 2
</column>
<column>
20/09/1987
</column>
<column>
37999131814
</column>
<column>
[email protected]
</column>
<column>
Aluno Regularmente Matriculado
</column>
</row>
</table>
What do you want to test on the structure? The nodes' names, their position, quantity, type of values...?
– Ricardo BRGWeb
@Ricardobrgweb I need to validate the structure (each 6 column Row) and the data type of each column
– adrianosymphony