highsource/jsonix-schema-compiler

Property already defined error when trying to generate FIXM mappings

ghettosamson opened this issue · 1 comments

I am currently trying to generate the FIXM 4.1 mappings to use within my Node app, using the following command:
java -jar node_modules/jsonix/lib/jsonix-schema-compiler-full.jar -d mappings -p FIXM Fixm.xsd I've included all the XSDs in my directory. I get the follwing error:

[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
  line 232 of http://www.w3.org/1999/xlink.xsd

[ERROR] The following location is relevant to the above error
  line 219 of http://www.w3.org/1999/xlink.xsd

[ERROR] Property "Title" is already defined. Use <jaxb:property> to resolve this conflict.
  line 261 of http://www.w3.org/1999/xlink.xsd

[ERROR] The following location is relevant to the above error
  line 246 of http://www.w3.org/1999/xlink.xsd

[ERROR] org.hisrc.jsonix.execution.JsonixInvoker - The model is null, there was probably a problem parsing schemas.

You have to customize code generation using a bindings file.

Create a bindings file bindings.xjb as follows:

<jaxb:bindings version="1.0" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
	xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" 
	jaxb:extensionBindingPrefixes="xjc">

	<jaxb:bindings scd="x-schema::xlink" xmlns:xlink="http://www.w3.org/1999/xlink">
		<jaxb:bindings scd="/group::xlink:locatorModel/model::sequence/xlink:title">
			<jaxb:property name="LocatorTitle"/>
		</jaxb:bindings>
	</jaxb:bindings>

</jaxb:bindings>

Include in in with -b bindings.xjb.