Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » XSD file - Restriction from imported namespace(XSD file - Restriction from imported namespace)
XSD file - Restriction from imported namespace [message #1826147] Mon, 20 April 2020 08:39 Go to next message
Andy Bayer is currently offline Andy BayerFriend
Messages: 1
Registered: April 2020
Junior Member
Hello, I'm new in this forum.

I have already sunk into the problem for a few hours but without any result, so hopefully I will find a solution here.

I am currently developing a structure for a complex application to enter information and select a specified value.

In a base I need some values ​​that are always the same globally, but the available values ​​are always different or should access a global specification. (This relates to my complex project)


My problem:

The base class is in a specially provided XSD file. (following: Q2)

If I only want to apply a restriction with regard to the imported XSD file (following .: Basis from Q2), I get an error: "derivation-ok-restriction.5.4.2: Error for type 'restriction'. The particle of the type is not a valid restriction of the particle of the base. "

So that I have ruled out mistakes on my part for testing (I am learning the language completely new), I have copied the base class into the target XSD and this works perfectly.


here the short source code:


    <!-- copie from namespace Q2  -->
     <complexType name="Basis">
    	<sequence>
    		<element name="StringElement" type="string"></element>
    	</sequence>
    </complexType>

	<!-- invalid -->
     <complexType name="restriction">
     	<complexContent>
            <restriction base="Q2:Basis">
            	<sequence>
            		<element name="StringElement" type="string"></element>
            	</sequence>
            </restriction>
     	</complexContent>
     </complexType>

	<!-- valid -->
     <complexType name="restriction_local">
     	<complexContent>
            <restriction base="tns:Basis">
            	<sequence>
            		<element name="StringElement" type="string"></element>
            	</sequence>
            </restriction>
     	</complexContent>
     </complexType>



Re: XSD file - Restriction from imported namespace [message #1826200 is a reply to message #1826147] Tue, 21 April 2020 05:02 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31230
Registered: July 2009
Senior Member
This forum is specifically for asking questions about how to use the org.eclipse.xsd EMF model, not a general forum for asking questions about XML Schema itself.

My guess would be that there is an issue related to element qualification. The schema element itself can contain the attribute elementFormDefault="qualified" and if the other scheme does that, all its local elements will implicitly be qualified with that schema's targetNamespace. That will make it hard (impossible) for you in a different schema with a different targetNamespace to restrict those elements because there is no way to declare an element with a namespace different than its containing schema's namespace.
Previous Topic:XSD with a variable subtree definition
Next Topic:XML Schema Editor black text on dark background
Goto Forum:
  


Current Time: Sat Jul 04 19:54:08 GMT 2020

Powered by FUDForum. Page generated in 0.01855 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top