my dog learned polymorphism*
The moose likes XML and Related Technologies and the fly likes unqualified elementFormDefault and defaultNamespace Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "unqualified elementFormDefault and defaultNamespace" Watch "unqualified elementFormDefault and defaultNamespace" New topic
Author

unqualified elementFormDefault and defaultNamespace

Sudhanshu Mishra
Ranch Hand

Joined: May 28, 2011
Posts: 215

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

Joined: Jan 18, 2011
Posts: 499
    
    3
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unqualified elementFormDefault and defaultNamespace
 
Similar Threads
How to use elementFormDefault and attributeFormDefault?
Namespaces in Schema - basic question
addition of namespace to every element
Apache ODE Webservices
Question about elementFormDefault