MSXML VBA: Validating XML against XSD: “The '' namespace provided differs from the schema's targetNamespace.”

后端 未结 2 1009
野趣味
野趣味 2021-01-02 18:25

I’m trying to validate an .XML file against an .XSD file with MSXML 6.0 DOM but on executing the code I’m getting this error message:

Test.xsd#/schema/target         


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 18:29

    You shouldn't have to change anything in your xml/xsd, since together they are valid. The problem is in your code, so I would suggest to take a look at this sample that shows what I think is different than your code: when you add the XSD to the cache, use the target namespace http://somewhere.com/root instead of the empty string.

提交回复
热议问题