What's the best way to validate an XML file against an XSD file?

前端 未结 13 1555
滥情空心
滥情空心 2020-11-22 07:37

I\'m generating some xml files that needs to conform to an xsd file that was given to me. What\'s the best way to verify they conform?

13条回答
  •  忘掉有多难
    2020-11-22 08:19

    If you have a Linux-Machine you could use the free command-line tool SAXCount. I found this very usefull.

    SAXCount -f -s -n my.xml
    

    It validates against dtd and xsd. 5s for a 50MB file.

    In debian squeeze it is located in the package "libxerces-c-samples".

    The definition of the dtd and xsd has to be in the xml! You can't config them separately.

提交回复
热议问题