Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 330200

Summary: Provide means for user to abort "Create XML Schema to Ecore Map"
Product: [Modeling] EMF Reporter: beny
Component: XML/XMIAssignee: Ed Merks <Ed.Merks>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description beny CLA 2010-11-14 12:12:51 EST
Build Identifier: Occurs on 3.5, 3.6, and 3.7

Something about the XSD at "http://www.ddialliance.org/sites/default/files/Version2-1.xsd" causes the "Create XML Schema to Ecore Map" option to never complete, hanging the IDE.

If the problem is with the schema, the mapping software should be enhanced to detect the problem and exit with an error. 

Thank you for helping me with this issue. 


Reproducible: Always

Steps to Reproduce:
1. Create a new EMF project
2. Specify to create from an XSD
3. Enter in the URI "http://www.ddialliance.org/sites/default/files/Version2-1.xsd"  (or alternatively download that XSD to your machine and select it via the appropriate button)
4. Click "Create XML Schema to Ecore Map"; app will hang
5. Leave your computer running overnight;  never finishes
Comment 1 beny CLA 2010-11-14 12:52:41 EST
I was able to clear this up by commenting out a portion of the XSD.  I commented out the elements used in the group "FORM", i.e.
    
         ...
	<xs:group name="FORM">
		<xs:choice>
			<xs:element name="div" type="divType"/>
			<xs:element name="emph" type="emphType"/>
			<xs:element name="head" type="headType"/>
			<xs:element name="hi" type="hiType"/>
			<xs:element name="itm" type="itmType"/>
			<xs:element name="list" type="listType"/>
			<xs:element name="p" type="pType"/>
		</xs:choice>
	</xs:group>
        ...

became

         ...
	<xs:group name="FORM">
		<xs:choice>
		<!-- <xs:element name="div" type="divType"/>
		   <xs:element name="emph" type="emphType"/>
		   <xs:element name="head" type="headType"/>
	     	   <xs:element name="hi" type="hiType"/>
		   <xs:element name="itm" type="itmType"/>
		   <xs:element name="list" type="listType"/>
		   <xs:element name="p" type="pType"/> -->
		</xs:choice>
	</xs:group>
        ...

The XSD apparently uses this group in 118 elements, and each of the element types here are recursive, in that e.g. divType, pType, etc. also use the FORM group.   So, I'm thinking this probably WOULD finish, if I just gave the code a couple of days to run.  

Therefore, this isn't so much a bug as a feature request for a means to abort a long-running "Create XML Schema to Ecore Map" execution.  I'll modify the bug as such. 

Thanks for your time. 

(In reply to comment #0)
> Build Identifier: Occurs on 3.5, 3.6, and 3.7
> 
> Something about the XSD at
> "http://www.ddialliance.org/sites/default/files/Version2-1.xsd" causes the
> "Create XML Schema to Ecore Map" option to never complete, hanging the IDE.
> 
> If the problem is with the schema, the mapping software should be enhanced to
> detect the problem and exit with an error. 
> 
> Thank you for helping me with this issue. 
> 
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Create a new EMF project
> 2. Specify to create from an XSD
> 3. Enter in the URI
> "http://www.ddialliance.org/sites/default/files/Version2-1.xsd"  (or
> alternatively download that XSD to your machine and select it via the
> appropriate button)
> 4. Click "Create XML Schema to Ecore Map"; app will hang
> 5. Leave your computer running overnight;  never finishes
Comment 3 Ed Merks CLA 2013-07-10 11:27:38 EDT
The changes are available in Kepler.