No matching global declaration available for the validation root

前端 未结 3 1366
春和景丽
春和景丽 2020-12-25 09:44

Background

Validate an XML document using a schema.

Problem

The simplest form of the problem is shown in two files.

XML Document

<
3条回答
  •  悲哀的现实
    2020-12-25 10:21

    You need to change your XML instance. Your current one says that there is a type called description in the namespace http://www.namespace.org/recipe. However, in your XSD definition, the only types exposed in that namespace are called recipe and descriptionType.

    So either define a type called description in the XSD schema, or change your instance so you are referencing the recipe type correctly:

    
    
      
        sugar cookies
      
    
    

    UPDATE This is only half the solution - the other half is in @Aravind's answer here: https://stackoverflow.com/a/8426185/569662

提交回复
热议问题