Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to annotate genmodel with a relative import location?
https://www.eclipse.org/forums/index.php/mv/msg/188701/598627/#msg_598627
for an import?
I successfully generate an eCore model and genmodel from this schema.
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.acme.com/vehicles"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ns1="http://www.acme.com/parts"
targetNamespace="http://www.acme.com/vehicles"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.acme.com/parts"
schemaLocation="Parts.xsd"/>
<xs:element name="car">
<xs:complexType>
<xs:sequence>
<xs:element ref="ns1:wheel"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
From the eCore model I want to export the model to an XSD. When I export I
get this schema.
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:parts="http://www.acme.com/parts"
xmlns:vehicles="http://www.acme.com/vehicles"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
ecore:documentRoot="DocumentRoot" ecore:nsPrefix="vehicles"
ecore:package="com.acme.vehicles"
targetNamespace="http://www.acme.com/vehicles">
<xsd:import namespace="http://www.acme.com/parts"
schemaLocation="file:/C:/working/eclipse/cars/parts.xsd"/>
<xsd:element name="car" type="vehicles:car_._type"/>
<xsd:complexType ecore:name="CarType" name="car_._type">
<xsd:sequence>
<xsd:element ref="parts:wheel"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
How can I make the value of the schemaLocation in the import be the relative
location of "parts.xsd"? I do not want "platform" as the scheme for my URIs.
I want to do this using annotations/detail on the genmodel rather than
coding around it.