1

I need to validate an XML against an XSD, I am using xmllint:

xmllint --schema schema.xsd feed.xml --noout

But it seems that I cannot save the output of the validation to a file.

Using -o or --output or > to redirect the output to a file will output the parse XML, but how do I redirect the validation errors to file?

kjhughes
  • 98,039
  • 18
  • 159
  • 218

1 Answers1

1

You can redirect stderr in general via 2>, so

xmllint --schema try.xsd try.xml --noout 2>errors.txt
                                         ^^^^^^^^^^^^

will redirect the errors to errors.txt.

kjhughes
  • 98,039
  • 18
  • 159
  • 218