• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unqualified elementFormDefault and defaultNamespace

 
Sudhanshu Mishra
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
What happens if i use elementFormDefault="unqualified" in schema file,and in corresponding xml file I use targetNamespace in schema file as defaultNamespace?
Basically I want to ask why elementFormDefault="unqualified" is not used with defaultNamespaces,even if they are the same as targetNamespace in XML schema.
Thanks.
 
g tsuji
Ranch Hand
Posts: 669
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens if i use elementFormDefault="unqualified" in schema file,and in corresponding xml file I use targetNamespace in schema file as defaultNamespace?

There is no a priori exclusivity of [1] elementFormDefault unqualified in xsd and [2] targetNamespace in the xsd being the default namespace in the target validated xml document. There is none. Only that there are concepts of global and local elements being validated and that those local elements in the xsd might thereby being forced to appearing in the validated target xml document with those funny xmlns="" highlighting they being in the null namespace outside of the targetNamespace.

Basically I want to ask why elementFormDefault="unqualified" is not used with defaultNamespaces,even if they are the same as targetNamespace in XML schema.

They can be used together, so your premise of "not used with" is incorrect. It could be used with. In any case, xsd has no a priori knowledge whether the target xml documents it is attempting to valid use or not default namespace as xsd's targetNamespace.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic