libxml2 - validate XML document against schema. Retrieve schema url from the actual XML file
I need to validate a xml file against DTD schema. I found out that I need to pass the source of schema file for validation. Is that possible to make libxml2 find the declaration of schema in XML file and do the validation on its own, or do I have to retrieve开发者_如何学编程 the declaration manually?
Thanks in advance Michal
In theory you could use put an xsi:schemaLocation
attribute in the XML file and let the XML processors find out where the XML Schema is.
The status of xsi:schemaLocation
in libXML is unclear, see this bug report: https://bugzilla.gnome.org/show_bug.cgi?id=157205. It seems implemented in the library itself but not enabled in the provided xmllint
util.
精彩评论