Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » How to annotate genmodel with a relative import location?
How to annotate genmodel with a relative import location? [message #598627] Sat, 26 August 2006 19:21
Matthew Rawlings is currently offline Matthew Rawlings
Messages: 39
Registered: July 2009
Member
How can I annotate the genmodel to generate the correct schemaLocation value
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.

- Matthew
Previous Topic:Loading Platform Resource URI based XML Schema
Next Topic:How to annotate genmodel with a relative import location?
Goto Forum:
  


Current Time: Thu Oct 23 12:35:27 GMT 2014

Powered by FUDForum. Page generated in 0.01634 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software