XSD schema not generated when ns prefix empty in ecore? [message #518746] |
Thu, 04 March 2010 21:24 |
keller_jens Messages: 21 Registered: March 2010 Location: Germany |
Junior Member |
|
|
Hi,
in my genmodel I've set generateSchema=true, and observed the following:
When the Ns Prefix in the ecore package is empty
(nsPrefix="") and I generate the model classes, the
.xsd and the .xsd2ecore file are not generated.
But in our xml files which are modelled here, the elements don't have a prefx, so I must maintain nsPrefix="" in the ecore, right? Otherwise, when I create an xml file using the generated wizard and edit with the generated editor, all elements have this prefix in the file.
But on the other hand I want the ecore file to be the "leading" model artifact, because it is much easier to read and to maintain changes here.
But our xsd schemas should be consistent with the ecore, so whenever I want to make a change to the model in the ecore and re-generate the model classes, I want that the xsd file is also re-generated.
How can I achieve this?
Best regards,
Jens
|
|
|
Re: XSD schema not generated when ns prefix empty in ecore? [message #518750 is a reply to message #518746] |
Thu, 04 March 2010 21:29 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Jens,
Comments below.
Jens Keller wrote:
> Hi,
> in my genmodel I've set generateSchema=true, and observed the following:
That schema generator is really horrible. You should be using the
Export facility to produce schemas.
>
> When the Ns Prefix in the ecore package is empty
> (nsPrefix="") and I generate the model classes, the xsd and the
> .xsd2ecore file are not generated.
>
> But in our xml files which are modelled here, the elements don't have
> a prefx, so I must maintain nsPrefix="" in the ecore, right?
> Otherwise, when I create an xml file using the generated wizard and
> edit with the generated editor, all elements have this prefix in the
> file.
Don't confuse there being a default prefix with there being no prefix
though...
>
> But on the other hand I want the ecore file to be the "leading" model
> artifact, because it is much easier to read and to maintain changes here.
>
> But our xsd schemas should be consistent with the ecore, so whenever I
> want to make a change to the model in the ecore and re-generate the
> model classes, I want that the xsd file is also re-generated.
What kind of serialization do you use? Can you show an example of the XML?
>
> How can I achieve this?
>
> Best regards,
> Jens
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
Re: XSD schema not generated when ns prefix empty in ecore? [message #518943 is a reply to message #518900] |
Fri, 05 March 2010 14:18 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------000203040202050402050504
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Jens,
So I have a patch to fix the bug once you open it. It then generates
this schema:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns="http://www.test.org/prettyurl" ecore:nsPrefix=""
ecore:package="prettyurl"
targetNamespace="http://www.test.org/prettyurl">
<xsd:element name="appPUrl" type="appPUrlType"/>
<xsd:complexType ecore:name="AppPUrlType" name="appPUrlType">
<xsd:sequence>
<xsd:element form="qualified" name="moduleRule"
type="moduleRuleType"/>
<xsd:element form="qualified" maxOccurs="unbounded"
name="commonRule" type="commonRuleType"/>
<xsd:element form="qualified" maxOccurs="unbounded"
name="pageRule" type="pageRuleType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType ecore:name="CommonRuleType" name="commonRuleType">
<xsd:sequence>
<xsd:element form="qualified" name="prettyUrl" type="xsd:string"/>
<xsd:element form="qualified" name="internalUrl"
type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
</xsd:complexType>
<xsd:complexType ecore:name="ModuleRuleType" name="moduleRuleType">
<xsd:sequence>
<xsd:element form="qualified" name="prettyUrl" type="xsd:string"/>
<xsd:element form="qualified" name="internalUrl"
type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType ecore:name="PageRuleType" name="pageRuleType">
<xsd:sequence>
<xsd:element form="qualified" name="prettyUrl" type="xsd:string"/>
<xsd:element form="qualified" name="internalUrl"
type="xsd:string"/>
<xsd:element form="qualified" name="ruleSet" type="ruleSetType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType ecore:name="RuleSetType" name="ruleSetType">
<xsd:sequence>
<xsd:element form="qualified" name="rule" type="ruleType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType ecore:name="RuleType" name="ruleType">
<xsd:attribute name="ref" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:schema>
I generally wouldn't recommend using nsPrefix="" because once you use
the absent prefix to denote a non-null namespace, the null namespace
becomes unavailable for use. In your case that's no big deal, but if
your model was used with some other model, one with unqualified
elements, it wouldn't work well.
An alternative is to set the prefix on your document root.
documentRoot.getXMLNSPrefixMap().put("",
PrettyurlPackage.eNS_URI);
You might tailor the wizard to do that.
Ed Merks wrote:
> Jens,
>
> Please open a bugzilla for problem of an exception when generating the
> schema. The converter shouldn't pass bad data to the XSD API. I'll
> fix that problem and then I'll look at the rest of this when I get
> back from swimming.
>
>
> Jens Keller wrote:
>> Hi Ed,
>> I've tried this "Export model" functionality and selected "XML
>> Schema" in the pop-up window.
>>
>> But I got an error - InvocationTargetException.
>> The details showed the following
>>
>> java.lang.IllegalArgumentException: The default prefix should
>> represented as null rather than as a zero length String
>> at org.eclipse.xsd.impl.XSDSchemaImpl$1.put(XSDSchemaImpl.java: 768)
>>
>> I'm sure it's because of the nsPrefix="" in the ecore. But if I don't
>> maintain this attribute at all, I get an exception "The namespace
>> prefix 'null' is not well formed.
>>
>> My ecore file is:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <ecore:EPackage xmi:version="2.0"
>> xmlns:xmi="http://www.omg.org/XMI"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="prettyurl"
>> nsURI="http://www.test.org/prettyurl" nsPrefix="">
>> <eClassifiers xsi:type="ecore:EClass" name="AppPUrlType">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value="appPUrlType"/>
>> <details key="kind" value="elementOnly"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EReference" name="moduleRule"
>> lowerBound="1"
>> eType="#//ModuleRuleType" containment="true"
>> resolveProxies="false">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="moduleRule"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EReference" name="commonRule"
>> lowerBound="1"
>> upperBound="-1" eType="#//CommonRuleType" containment="true"
>> resolveProxies="false">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="commonRule"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EReference" name="pageRule"
>> lowerBound="1"
>> upperBound="-1" eType="#//PageRuleType" containment="true"
>> resolveProxies="false">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="pageRule"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="CommonRuleType">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value="commonRuleType"/>
>> <details key="kind" value="elementOnly"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="prettyUrl"
>> lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="prettyUrl"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute"
>> name="internalUrl" lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="internalUrl"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
>> lowerBound="1" eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="attribute"/>
>> <details key="name" value="id"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="DocumentRoot">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value=""/>
>> <details key="kind" value="mixed"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed"
>> unique="false" upperBound="-1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="elementWildcard"/>
>> <details key="name" value=":mixed"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EReference"
>> name="xMLNSPrefixMap" upperBound="-1"
>> eType="ecore:EClass
>> http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEn try"
>> transient="true" containment="true" resolveProxies="false">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="attribute"/>
>> <details key="name" value="xmlns:prefix"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EReference"
>> name="xSISchemaLocation" upperBound="-1"
>> eType="ecore:EClass
>> http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEn try"
>> transient="true" containment="true" resolveProxies="false">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="attribute"/>
>> <details key="name" value="xsi:schemaLocation"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EReference" name="appPUrl"
>> upperBound="-2"
>> eType="#//AppPUrlType" volatile="true" transient="true"
>> derived="true" containment="true"
>> resolveProxies="false">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="appPUrl"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="ModuleRuleType">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value="moduleRuleType"/>
>> <details key="kind" value="elementOnly"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="prettyUrl"
>> lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="prettyUrl"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute"
>> name="internalUrl" lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="internalUrl"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="PageRuleType">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value="pageRuleType"/>
>> <details key="kind" value="elementOnly"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="prettyUrl"
>> lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="prettyUrl"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EAttribute"
>> name="internalUrl" lowerBound="1"
>> eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="internalUrl"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> <eStructuralFeatures xsi:type="ecore:EReference" name="ruleSet"
>> lowerBound="1"
>> eType="#//RuleSetType" containment="true" resolveProxies="false">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="ruleSet"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="RuleSetType">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value="ruleSetType"/>
>> <details key="kind" value="elementOnly"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EReference" name="rule"
>> lowerBound="1" eType="#//RuleType"
>> containment="true" resolveProxies="false">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="element"/>
>> <details key="name" value="rule"/>
>> <details key="namespace" value="##targetNamespace"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> <eClassifiers xsi:type="ecore:EClass" name="RuleType">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="name" value="ruleType"/>
>> <details key="kind" value="empty"/>
>> </eAnnotations>
>> <eStructuralFeatures xsi:type="ecore:EAttribute" name="ref"
>> lowerBound="1" eType="ecore:EDataType
>> http://www.eclipse.org/emf/2003/XMLType#//String">
>> <eAnnotations
>> source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
>> <details key="kind" value="attribute"/>
>> <details key="name" value="ref"/>
>> </eAnnotations>
>> </eStructuralFeatures>
>> </eClassifiers>
>> </ecore:EPackage>
>>
>>
>>
>>
>> An example for the corresponding XML file:
>>
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <appPUrl xmlns="http://www.test.org/prettyurl">
>> <moduleRule>
>> <prettyUrl>/$i18n:example.ui.prettyurl.test$
>> </prettyUrl>
>> <internalUrl>/example
>> </internalUrl>
>> </moduleRule>
>> <commonRule id="cr1">
>> <prettyUrl>/$i18n:example.ui.prettyurl.test1$/$word$
>> </prettyUrl>
>> <internalUrl>exampleId=$1</internalUrl>
>> </commonRule>
>> <commonRule id="cr2">
>> <prettyUrl>/$word$</prettyUrl>
>> <internalUrl>exampleId=$1</internalUrl>
>> </commonRule>
>> <pageRule>
>> <prettyUrl>/$i18n:example.ui.prettyurl.main$
>> </prettyUrl>
>> <internalUrl>$page_sep$Example$target_sep$list.xhtml
>> </internalUrl>
>> <ruleSet>
>> <rule ref="cr1" />
>> </ruleSet>
>> </pageRule>
>> <pageRule>
>> <prettyUrl>/details</prettyUrl>
>> <internalUrl>$page_sep$Example$target_sep$details.xhtml
>> </internalUrl>
>> <ruleSet>
>> <rule ref="cr2" />
>> </ruleSet>
>> </pageRule>
>> <pageRule>
>> <prettyUrl>/detailsWithParams</prettyUrl>
>> <internalUrl>
>> $page_sep$Example$target_sep$detailsWithParams.xhtml
>> </internalUrl>
>> <ruleSet>
>> <rule ref="cr2" />
>> </ruleSet>
>> </pageRule>
>> <pageRule>
>> <prettyUrl>/dynamicui</prettyUrl>
>> <internalUrl>$page_sep$DynamicUI$target_sep$dynamicUI.xhtml
>> </internalUrl>
>> <ruleSet>
>> <rule ref="cr1" />
>> </ruleSet>
>> </pageRule>
>> </appPUrl>
>>
>> Hope this answers the question regarding serialization?
>>
>> Best regards,
>> Jens
--------------000203040202050402050504
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Jens,<br>
<br>
So I have a patch to fix the bug once you open it. It then generates
this schema:<br>
<blockquote><?xml version="1.0" encoding="UTF-8"?><br>
<xsd:schema xmlns:xsd=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>
xmlns:ecore=<a class="moz-txt-link-rfc2396E" href="http://www.eclipse.org/emf/2002/Ecore">"http://www.eclipse.org/emf/2002/Ecore"</a>
xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.test.org/prettyurl">"http://www.test.org/prettyurl"</a> ecore:nsPrefix=""
ecore:package="prettyurl"
targetNamespace=<a class="moz-txt-link-rfc2396E" href="http://www.test.org/prettyurl">"http://www.test.org/prettyurl"</a>><br>
<xsd:element name="appPUrl" type="appPUrlType"/><br>
<xsd:complexType ecore:name="AppPUrlType" name="appPUrlType"><br>
<xsd:sequence><br>
<xsd:element form="qualified" name="moduleRule"
type="moduleRuleType"/><br>
<xsd:element form="qualified" maxOccurs="unbounded"
name="commonRule" type="commonRuleType"/><br>
<xsd:element form="qualified" maxOccurs="unbounded"
name="pageRule" type="pageRuleType"/><br>
</xsd:sequence><br>
</xsd:complexType><br>
<xsd:complexType ecore:name="CommonRuleType"
name="commonRuleType"><br>
<xsd:sequence><br>
<xsd:element form="qualified" name="prettyUrl"
type="xsd:string"/><br>
<xsd:element form="qualified" name="internalUrl"
type="xsd:string"/><br>
</xsd:sequence><br>
<xsd:attribute name="id" type="xsd:string" use="required"/><br>
</xsd:complexType><br>
<xsd:complexType ecore:name="ModuleRuleType"
name="moduleRuleType"><br>
<xsd:sequence><br>
<xsd:element form="qualified" name="prettyUrl"
type="xsd:string"/><br>
<xsd:element form="qualified" name="internalUrl"
type="xsd:string"/><br>
</xsd:sequence><br>
</xsd:complexType><br>
<xsd:complexType ecore:name="PageRuleType" name="pageRuleType"><br>
<xsd:sequence><br>
<xsd:element form="qualified" name="prettyUrl"
type="xsd:string"/><br>
<xsd:element form="qualified" name="internalUrl"
type="xsd:string"/><br>
<xsd:element form="qualified" name="ruleSet"
type="ruleSetType"/><br>
</xsd:sequence><br>
</xsd:complexType><br>
<xsd:complexType ecore:name="RuleSetType" name="ruleSetType"><br>
<xsd:sequence><br>
<xsd:element form="qualified" name="rule" type="ruleType"/><br>
</xsd:sequence><br>
</xsd:complexType><br>
<xsd:complexType ecore:name="RuleType" name="ruleType"><br>
<xsd:attribute name="ref" type="xsd:string" use="required"/><br>
</xsd:complexType><br>
</xsd:schema><br>
</blockquote>
I generally wouldn't recommend using nsPrefix="" because once you use
the absent prefix to denote a non-null namespace, the null namespace
becomes unavailable for use. In your case that's no big deal, but if
your model was used with some other model, one with unqualified
elements, it wouldn't work well.<br>
<br>
An alternative is to set the prefix on your document root.<br>
<br>
documentRoot.getXMLNSPrefixMap().put("",
PrettyurlPackage.eNS_URI);<br>
<br>
You might tailor the wizard to do that.<br>
<br>
<br>
Ed Merks wrote:
<blockquote cite="mid:hmqrf0$j51$1@build.eclipse.org" type="cite">Jens,
<br>
<br>
Please open a bugzilla for problem of an exception when generating the
schema. The converter shouldn't pass bad data to the XSD API. I'll
fix that problem and then I'll look at the rest of this when I get back
from swimming.
<br>
<br>
<br>
Jens Keller wrote:
<br>
<blockquote type="cite">Hi Ed,
<br>
I've tried this "Export model" functionality and selected "XML Schema"
in the pop-up window.
<br>
<br>
But I got an error - InvocationTargetException.
<br>
The details showed the following
<br>
<br>
java.lang.IllegalArgumentException: The default prefix should
represented as null rather than as a zero length String
<br>
at org.eclipse.xsd.impl.XSDSchemaImpl$1.put(XSDSchemaImpl.java: 768)
<br>
<br>
I'm sure it's because of the nsPrefix="" in the ecore. But if I don't
maintain this attribute at all, I get an exception "The namespace
prefix 'null' is not well formed.
<br>
<br>
My ecore file is:
<br>
<br>
<?xml version="1.0" encoding="UTF-8"?>
<br>
<ecore:EPackage xmi:version="2.0"
<br>
xmlns:xmi=<a class="moz-txt-link-rfc2396E" href="http://www.omg.org/XMI">"http://www.omg.org/XMI"</a>
xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>
<br>
xmlns:ecore=<a class="moz-txt-link-rfc2396E" href="http://www.eclipse.org/emf/2002/Ecore">"http://www.eclipse.org/emf/2002/Ecore"</a> name="prettyurl"
<br>
nsURI=<a class="moz-txt-link-rfc2396E" href="http://www.test.org/prettyurl">"http://www.test.org/prettyurl"</a> nsPrefix="">
<br>
<eClassifiers xsi:type="ecore:EClass" name="AppPUrlType">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="name" value="appPUrlType"/>
<br>
<details key="kind" value="elementOnly"/>
<br>
</eAnnotations>
<br>
<eStructuralFeatures xsi:type="ecore:EReference"
name="moduleRule" lowerBound="1"
<br>
eType="#//ModuleRuleType" containment="true"
resolveProxies="false">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="moduleRule"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
<eStructuralFeatures xsi:type="ecore:EReference"
name="commonRule" lowerBound="1"
<br>
upperBound="-1" eType="#//CommonRuleType" containment="true"
resolveProxies="false">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="commonRule"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
<eStructuralFeatures xsi:type="ecore:EReference" name="pageRule"
lowerBound="1"
<br>
upperBound="-1" eType="#//PageRuleType" containment="true"
resolveProxies="false">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="pageRule"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
</eClassifiers>
<br>
<eClassifiers xsi:type="ecore:EClass" name="CommonRuleType">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="name" value="commonRuleType"/>
<br>
<details key="kind" value="elementOnly"/>
<br>
</eAnnotations>
<br>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="prettyUrl"
lowerBound="1"
<br>
eType="ecore:EDataType
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2003/XMLType#//String">http://www.eclipse.org/emf/2003/XMLType#//String</a>">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="prettyUrl"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
<eStructuralFeatures xsi:type="ecore:EAttribute"
name="internalUrl" lowerBound="1"
<br>
eType="ecore:EDataType
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2003/XMLType#//String">http://www.eclipse.org/emf/2003/XMLType#//String</a>">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="internalUrl"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
lowerBound="1" eType="ecore:EDataType
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2003/XMLType#//String">http://www.eclipse.org/emf/2003/XMLType#//String</a>">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="attribute"/>
<br>
<details key="name" value="id"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
</eClassifiers>
<br>
<eClassifiers xsi:type="ecore:EClass" name="DocumentRoot">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="name" value=""/>
<br>
<details key="kind" value="mixed"/>
<br>
</eAnnotations>
<br>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="mixed"
unique="false" upperBound="-1"
<br>
eType="ecore:EDataType
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry</a>">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="elementWildcard"/>
<br>
<details key="name" value=":mixed"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
<eStructuralFeatures xsi:type="ecore:EReference"
name="xMLNSPrefixMap" upperBound="-1"
<br>
eType="ecore:EClass
<a class="moz-txt-link-freetext" href=" http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEn try"> http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEn try</a>"
<br>
transient="true" containment="true" resolveProxies="false">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="attribute"/>
<br>
<details key="name" value="xmlns:prefix"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
<eStructuralFeatures xsi:type="ecore:EReference"
name="xSISchemaLocation" upperBound="-1"
<br>
eType="ecore:EClass
<a class="moz-txt-link-freetext" href=" http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEn try"> http://www.eclipse.org/emf/2002/Ecore#//EStringToStringMapEn try</a>"
<br>
transient="true" containment="true" resolveProxies="false">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="attribute"/>
<br>
<details key="name" value="xsi:schemaLocation"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
<eStructuralFeatures xsi:type="ecore:EReference" name="appPUrl"
upperBound="-2"
<br>
eType="#//AppPUrlType" volatile="true" transient="true"
derived="true" containment="true"
<br>
resolveProxies="false">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="appPUrl"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
</eClassifiers>
<br>
<eClassifiers xsi:type="ecore:EClass" name="ModuleRuleType">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="name" value="moduleRuleType"/>
<br>
<details key="kind" value="elementOnly"/>
<br>
</eAnnotations>
<br>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="prettyUrl"
lowerBound="1"
<br>
eType="ecore:EDataType
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2003/XMLType#//String">http://www.eclipse.org/emf/2003/XMLType#//String</a>">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="prettyUrl"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
<eStructuralFeatures xsi:type="ecore:EAttribute"
name="internalUrl" lowerBound="1"
<br>
eType="ecore:EDataType
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2003/XMLType#//String">http://www.eclipse.org/emf/2003/XMLType#//String</a>">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="internalUrl"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
</eClassifiers>
<br>
<eClassifiers xsi:type="ecore:EClass" name="PageRuleType">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="name" value="pageRuleType"/>
<br>
<details key="kind" value="elementOnly"/>
<br>
</eAnnotations>
<br>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="prettyUrl"
lowerBound="1"
<br>
eType="ecore:EDataType
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2003/XMLType#//String">http://www.eclipse.org/emf/2003/XMLType#//String</a>">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="prettyUrl"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
<eStructuralFeatures xsi:type="ecore:EAttribute"
name="internalUrl" lowerBound="1"
<br>
eType="ecore:EDataType
<a class="moz-txt-link-freetext" href="http://www.eclipse.org/emf/2003/XMLType#//String">http://www.eclipse.org/emf/2003/XMLType#//String</a>">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="internalUrl"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
<eStructuralFeatures xsi:type="ecore:EReference" name="ruleSet"
lowerBound="1"
<br>
eType="#//RuleSetType" containment="true"
resolveProxies="false">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="kind" value="element"/>
<br>
<details key="name" value="ruleSet"/>
<br>
<details key="namespace" value="##targetNamespace"/>
<br>
</eAnnotations>
<br>
</eStructuralFeatures>
<br>
</eClassifiers>
<br>
<eClassifiers xsi:type="ecore:EClass" name="RuleSetType">
<br>
<eAnnotations
source=<a class="moz-txt-link-rfc2396E" href="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">"http:///org/eclipse/emf/ecore/util/ExtendedMetaData"</a>>
<br>
<details key="name" value="ruleSetType"/>
<br>
<details key="kind" v
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03181 seconds