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:
File ns-changed.xml
:
<?xml version="1.0"?>
<r:recipe xmlns:r="http://www.namespace.org/recipe">
<description>
<title>sugar cookies</title>
</description>
</r:recipe>
UPDATE This is only half the solution – the other half is in @Aravind’s answer here: https://stackoverflow.com/a/8426185/569662