Avoid #-prefix in reference [message #482171] |
Tue, 25 August 2009 10:26  |
Eclipse User |
|
|
|
Hi,
I've got a model defined as xsd, and since another application generates
source on base of that xsd too, I would like to replace data type
xsd:IDREF by xsd:string for my references.
This change removes resolveProxies="false" from my eStructuralFeatures in
ecore, and then my references are stored with a preceding "#" character.
So <xxx target="a" /> becomes
<xxx target="#a" />
What is the best way to avoid this "#"-character in my case?
Thanks in advance!
Peter
|
|
|
|
|
Re: Avoid #-prefix in reference [message #482311 is a reply to message #482310] |
Wed, 26 August 2009 04:06  |
Eclipse User |
|
|
|
Peter,
Comments below.
Peter Lang wrote:
> Hi Ed,
>
> It works, thanks a lot!
>
>>> What is the best way to avoid this "#"-character in my case?
>> I suppose adding ecore:resolveProxies="false" will help... I'mnot
>> sure why you'd want to turn off the fact that it's an ID when really
>> it is an ID...
> Well, I wanted to know if it's possible is, that we generate sources
> with Castor, and while xsd:ID results in a String, xsd:IDREF is
> represented as Object.
So Castor will try to resolve IDREFS is sound like... But it seems to
me that changing the schema to change what Castor generates breaks the
schema with respect to properly constraining the actual XML, which is
normally its primary purpose.
> What are the drawbacks of using string instead of xsd:IDREF?
The allowed values are not properly constrained and no other tool will
know the value is supposed to be a reference to an ID elsewhere in the
XML file...
>
> Peter
>
|
|
|
Powered by
FUDForum. Page generated in 0.02947 seconds