Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to rename a complexType/@name inside XML Schema. #454

Closed
angelozerr opened this issue Jun 20, 2019 · 2 comments · Fixed by #543
Closed

Ability to rename a complexType/@name inside XML Schema. #454

angelozerr opened this issue Jun 20, 2019 · 2 comments · Fixed by #543
Assignees
Labels
enhancement New feature or request rename
Milestone

Comments

@angelozerr
Copy link
Contributor

With the XSD file:

<?xml version="1.1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	 
	<xs:element name="employee" type="personinfo">
		  
	</xs:element>
	
	<xs:complexType name="personinfo">
		<xs:sequence> 
			<xs:element name="firstname" type="xs:string" />
			<xs:element name="lastname" type="xs:string" />
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="fullpersoninfo">
		<xs:complexContent>
			<xs:extension base="personinfo">
				<xs:sequence>
					<xs:element name="address" type="xs:string" />
					<xs:element name="city" type="xs:string" />
					<xs:element name="country" type="xs:string" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	
</xs:schema>

If we rename <xs:complexType name="personinfo"> to <xs:complexType name="XXXX"> we should have

<?xml version="1.1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	 
	<xs:element name="employee" type="XXXX">
		  
	</xs:element>
	
	<xs:complexType name="XXXX">
		<xs:sequence> 
			<xs:element name="firstname" type="xs:string" />
			<xs:element name="lastname" type="xs:string" />
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="fullpersoninfo">
		<xs:complexContent>
			<xs:extension base="XXXX">
				<xs:sequence>
					<xs:element name="address" type="xs:string" />
					<xs:element name="city" type="xs:string" />
					<xs:element name="country" type="xs:string" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	
</xs:schema>
@fbricon fbricon added the enhancement New feature or request label Jul 3, 2019
@fbricon fbricon added this to the v0.8.0 milestone Jul 3, 2019
@fbricon fbricon assigned xorye and unassigned angelozerr and NikolasKomonen Jul 3, 2019
@angelozerr angelozerr removed this from the v0.8.0 milestone Jul 18, 2019
@xorye
Copy link

xorye commented Jul 23, 2019

For this feature, is it possible for the references (the values that are being renamed) to be located in different files?

Currently, I am using XSDUtils.searchXSOriginAttributes() to find locations that need to be renamed.

@angelozerr
Copy link
Contributor Author

angelozerr commented Jul 23, 2019

For this feature, is it possible for the references (the values that are being renamed) to be located in different files?

Yes it will possible, but it will not supported for the moment. It's like other features with references, find definitions which works only in the file scope and not in external files. It should be improved in #484

So please continue to use XSDUtils.searchXSOriginAttributes() and when we will support #484, your rename should continue to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rename
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants