Hi, i have defined a very simple schema with namespace and have problem during insert a instance of this schema. i seems like this:
<xs:schema targetNamespace="NS" xmlns="NS" xmlns:tsd="http://namespaces.softwareag.com/tamino/TaminoSchemaDefinition" xmlns:xs="http://www.w3.org/2001/XMLSchema"> ..... <xs:element name = "person"> <xs:complexType> <xs:sequence> <xs:element name = "name" type = "xs:string"></xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
the instance is like this:
<person xmlns="NS"> <name>cat</name> </person>
the error message is: b:element content missing, minOccurs constraint violation in element declaration;[element’name’ in element ‘person’] [/b] I have no idea, what can be wrong [/b]
add to your stylesheet element: elementFormDefault=“qualified” Otherwise your schema declares name in the empty namespace, whereas this element appears in the namespace “NS”
Hi here is the answer: (1) element declarations which are direct children of the xs:schema node are named “global” - they do always belong to the targetNamespace. (2) non-global, i.e. local element declarations do not belong to the targetNamespace by default. You need to specify either the form=“qualified” attribute on a single element declaration or the elementFormDefault=“qualified” attribute on the xs:schema node in order to make ther local element declaration belonging to the targetNamespace. Regards Uli