• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

unqualified elementFormDefault and defaultNamespace

 
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Willie Smits increased rainfall 25% in three years by planting trees. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic