I want to validate my xml file and have to insert into sql server table whether it is valid or not and the reason if it is invalid.
I have user schemaValidate() to validate the file and libxml_get_errors(); to get the errors if it is not valid.
for example if i get errors message as follows
Error 1871 is Element 'from': This element is not expected. Expected is ( to ). on line 4
I need to insert above in reason field in my table but getting syntax error as it contains brackets (). How to solve this?