1

I have a program which uses the xmlschema library to first validate an XML input document using an XSD document. When I run the program using a specific XML input, I get the error: "Reason: Unexpected child with tag 'x' at position 3.

I'm wondering what is the meaning of "position 3" so that I can debug easier? Also, What is the meaning of the output it gives with "Schema:", "Instance:", and "Path:" so that I can understand and it's easier to debug? I assume Schema is what the XSD says, Instance is what is actually given in the XML input, and not sure exactly what the "Path:" is indicating.

Prospero
  • 109
  • 1
  • 11
  • I don't use that particular library but yes, in the context of W3C schemas the schema (set) is the set of XSD documents and the instance is a particular XML document to be validated against a schema (set). Path is usually an XPath to the section in the schema or the instance that is relevant for the validation problem. – Martin Honnen Jul 12 '22 at 08:13

0 Answers0