0

I try to find way to parse xml file using xmllint libxml2 with an external dtd file.

It's works with this :

xmllint --dtdvalid radar.dtd radar.xml --output radargood.xml

But this command doesn't do what i want.

--ouput is the result of parsing, i understand that.

Whatever the validity of xml, the ouput will be exactly the same.

How can i have a valide xml ouput by using dtd file of an invalid xml file ?

Thanks you a lot.

1 Answers1

1

You can't. How would xmllint know how to correct your invalid XML file?

Edit: you could try --recover, though I am not sure it will be useful on your case.

Remi Gacogne
  • 4,655
  • 1
  • 18
  • 22