This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I came across a paragraph as per the site
The elements and attributes declared within the xsd:complexType element are considered local to the complex type. Local elements and attributes can only be used within the context where they're defined. This raises an interesting question about whether local elements/attributes need to be namespace qualified in instance documents. Since local elements and attributes will always contain an ancestor element (typically a global element) qualified by the target namespace, one could argue that it's not necessary.
Now,what does it mean,that i do not have to use namespace prefixes for the child elements and attributes in the XML document?Do the global elements always have to be prefixed with their namespaces in the xml schema?
...Since local elements and attributes will always contain an ancestor element (typically a global element) qualified by the target namespace, one could argue that it's not necessary.
That is from some article. "One could argue"... that implies one could argue otherwise as well. So it has to be put it in the context of the complete article. That "argue" should just be trying to help anchoring something to readers' mind to help understanding of an aspect of the design. I wouldn't though "argue" otherwise with them. That wouldn't help.
Now,what does it mean,that i do not have to use namespace prefixes for the child elements and attributes in the XML document?
Now this is your digestion. Of course, it does not mean that. Besides, prefix is only an artefact for the convenience of the author of an instance xml document. Child elements and attributes have all the provisions available in the w3 schema language to be in any namespace imaginable. (It can be prefixed or non-prefixed in case of element having a default namespace; but for attributes, in case they are not in null namespace, must be prefixed.) But it is not easy to digested in one go, so I suggest you should not be too dragged by the leg by those subtleties before understanding other more readily unstandable and needed things first.
Do the global elements always have to be prefixed with their namespaces in the xml schema?
If the target namespace in the xml schema describing those globals (or locals, for that matter, be mindful) is not null and that the author of the instance document happens to not using default namespace for it, sure, it has to be prefixed. In case they are in null namespace, they aren't prefixed.