aspose file tools*
The moose likes XML and Related Technologies and the fly likes Referring local element of a different namespace in another xsd? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Referring local element of a different namespace in another xsd?" Watch "Referring local element of a different namespace in another xsd?" New topic
Author

Referring local element of a different namespace in another xsd?

rohit chawla
Greenhorn

Joined: Apr 05, 2011
Posts: 8
Requirement is such that I want only some elements defined in xsd's to be accessible as root elements.
So, for that the approach is to make all the other elements local by declaring complex types and referring them.

But, if those non-accessible or local elements are required in another xsd definition, in other words, they can be child elements of the elements belonging to some other namespace defined in a different xsd.

How to achieve this kind of schema definition?

For e.g In the following
say I only want A:root and custom:root to be valid roots not inner:A, so I declared innerA under the root element and referred the type, while A:innerA can come under the <custom:root> element?
I cannot define innerA in B.xsd, bcz it will make the innerA to be in B.xsd's targetnamespace i.e custom namespace.


For e.g.

A.xsd


B.xsd


The Fourth last line in above B.xsd causes error. How can I refer the innerA element. Any suggetions?


XML


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Referring local element of a different namespace in another xsd?