Hi,
I have a question in understanding one of the schemas generated by AXIS. I am putting it in a general way. I would appreciate any help from the people who are familiar with the understanding of schemas. I would like to confirm it with my understanding given below after the schema code. Here is the schema:
<schema targetNamespace="NSone"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:apa = "NSone">
<complexType name="Map">
<sequence>
<element name="items" nillable="true" minOccurs="0" maxOccurs="unbounded">
<apa:complexType>
<all>
<element name="key" nillable="true" type="xsd:string"/>
<element name="value" nillable="true" type="xsd:string"/>
</all>
</apa:complexType>
</element>
</sequence>
</complexType>
</schema>
My understanding is that a "complexType" should be of the same namespace as that of its parent "element". In the above code, complexType name="Map" is of targetNamespace type. but the local "element" name="items" belongs to the default namespace. Since I declared the child of that element (which is complexType) to be of namespace "xmlns:ap", I see a flaw in the schema code. I therefore say that if at all the complexType belongs to a different namespace than its parent "element", then we should declare it with a type="something" as an attribute to the "element" than as a child to it. Am I right in saying so? Any comments are appreciated.
Thanks,
Sateesh.
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!