Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Avoid #-prefix in reference
Avoid #-prefix in reference [message #482171] Tue, 25 August 2009 14:26 Go to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
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 #482173 is a reply to message #482171] Tue, 25 August 2009 14:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Peter,

Comments below.


Peter Lang wrote:
> 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?
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...
>
> Thanks in advance!
> Peter
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Avoid #-prefix in reference [message #482310 is a reply to message #482173] Wed, 26 August 2009 07:58 Go to previous messageGo to next message
Peter Lang is currently offline Peter LangFriend
Messages: 153
Registered: July 2009
Senior Member
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.
What are the drawbacks of using string instead of xsd:IDREF?

Peter
Re: Avoid #-prefix in reference [message #482311 is a reply to message #482310] Wed, 26 August 2009 08:06 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
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
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Databinding with DateTime
Next Topic:Some informations
Goto Forum:
  


Current Time: Sat Apr 27 00:28:17 GMT 2024

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

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

Back to the top