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

Bug 358163

Summary: XSDSchema.update does not update ref attribute on DOM element
Product: [Modeling] EMF Reporter: Shane Cartledge <shanec>
Component: XSDAssignee: Ed Merks <Ed.Merks>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Shane Cartledge CLA 2011-09-19 18:47:10 EDT
Build Identifier: org.eclipse.xsd_2.6.0



<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:element name="globalElement1">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="globalElement2"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="globalElement2">
		<xsd:complexType/>
	</xsd:element>

</xsd:schema>

Reproducible: Always

Steps to Reproduce:
1. Load the following schema:

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:element name="globalElement1">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref="globalElement2"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="globalElement2">
		<xsd:complexType/>
	</xsd:element>
</xsd:schema>

2. In the model rename globalElement2 to globalElement2A.
 
4. The ref attribute on the DOM object for the reference XSDElementDeclaration will still be ref="globalElement2".

5. Call update(true) on the XSDSchema object. Expected: The ref attribute on the DOM object will be updated to "globalElement2A". Actual: The ref attribute is not updated and is still "globalElement2".
Comment 1 Ed Merks CLA 2012-04-05 00:52:43 EDT
You need to call updateElement(true) to fully update the DOM to reflect the model changes.