Validating well formed xml c
For example, the following shows an XML document that references an external XSD schema, My Data.xsd, that is located on a Web server.
node and any of its children nodes that are not namespace prefixed.
'Create the schema cache and add the XSD schema to it. In this example, we show that the schema is Web-hosted at the ' Web site.
For instance, if you have a schema file on your system at the following path: for MSXML to locate and use the file.
The JAXP validation functions are based on the validation capabilities of the parsers API.
For more information, see Example 1: Validating with no Namespace Schema Location in either C/C , Example 1: Validating with no Namespace Schema Location (Visual Basic) or Example 1: Validating with no Namespace Schema Location (JScript).
The xsi:schema Location attribute works well in situations where namespace prefixes are explicitly declared and used in the XML document you want to validate.
If the file is not valid XML, MSXML will ignore it and validate for well-formed XML only.
To avoid this type of outcome, its a good practice to always validate your schema files first prior to attempting to use them in validation of other documents.