How to validate xml with available XSD?

Hi,

I am trying to validate xml with the available xsd and to do this I am using libxml-2(https://github.com/lestrrat/go-libxml2 : XSD Validation)

where it takes the XSD and parses it, but there is no api which will take whole xml are input.

the parsestring api which takes only the one element tag as string argument.

Is there is any api in libxml-2 where it will take whole xml and validate against xsd?

You could use ParseReader:

ParseReader parses XML from the given io.Reader and returns a Document.

Then you could continue as described on https://github.com/lestrrat/go-libxml2#xsd-validation

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.