Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

importing a schema into another

 
Enrico Scantamburlo
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to import some elements of another schema into a new one, they have different namespaces. I can do it successfully, however, I have problems validating the xml. The xml will be elaborated by an external program and there should not be any prefixes before the name of the tag (pe <tns:root> ... </tns:root> ) or xmlns attributes in nodes other than the root.

Example: this works

this works too

but i want this

Is this feasible? I have tried many combinations of elementFormDefault in both the schemas but I could not pull it off. thanks in advance
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the example that you want to work, the element imported_element will belong to "no namespace", is that what you want? (This article has more on namespaces)
If not, then you must specify the namespace of this element in the root (because according to the rules you have specified, you can not have it in the child element.) and use the prefix of the namespace with this element.

Something like:


[ April 10, 2008: Message edited by: Nitesh Kant ]
 
Enrico Scantamburlo
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot this solved my problem
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a good article. Thanks Nitesh Kant :thumb:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic