Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Unresolved reference '//@class.1'
icon9.gif  Unresolved reference '//@class.1' [message #1726284] Fri, 11 March 2016 05:38 Go to next message
Zuriel Morales is currently offline Zuriel MoralesFriend
Messages: 12
Registered: March 2016
Junior Member
We have a model and an Acceleo template to transform that model into web code.

The problem is that, in the model, the children of each element are ordered like this: 'hasOption="//@option.0 //@option.1 //@option.2 //@option.3"/>' and so on.

When trying to generate code from these models, we get an "Unresolved reference '//@option.1'" error, but it works fine if we reverse the order manually (like this: 'hasOption="//@option.3 //@option.2 //@option.1 //@option.0"/>').

Is there a way we can get Acceleo to read the elements in the correct/opposite order?

Here is an example of the model:
<?xml version="1.0" encoding="UTF-8"?>
<form_ecore:Website 
 xmi:version="2.0"
    xmlns:xmi="reference"
    xmlns:xsi="reference"
    xmlns:form_ecore="reference"
    xsi:schemaLocation="reference">
  <hasPage title="Google" hasForm="//@form.0"/>
  <form name="Login" send_text="Buscar" hasInput="//@text.0 //@combobox.0"/>
  <option value="1" display_text="1"/>
  <option value="2" display_text="2"/>
  <combobox name="tipo" label="Tipo" hasOption="//@option.0 //@option.1"/>
  <text name="Buscar"/>
</form_ecore:Website>
Re: Unresolved reference '//@class.1' [message #1726344 is a reply to message #1726284] Fri, 11 March 2016 15:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
I don't see any reason why that should make a difference. You could try
using XMLResource.OPTION_DEFER_IDREF_RESOLUTION for loading.


On 11.03.2016 14:22, Zuriel Morales wrote:
> We have a model and an Acceleo template to transform that model into
> web code.
>
> The problem is that, in the model, the children of each element are
> ordered like this: 'hasOption="//@option.0 //@option.1 //@option.2
> //@option.3"/>' and so on.
>
> When trying to generate code from these models, we get an "Unresolved
> reference '//@option.1'" error, but it works fine if we reverse the
> order manually (like this: 'hasOption="//@option.3 //@option.2
> //@option.1 //@option.0"/>').
>
> Is there a way we can get Acceleo to read the elements in the
> correct/opposite order?
>
> Here is an example of the model:
> <?xml version="1.0" encoding="UTF-8"?>
> <form_ecore:Website xmi:version="2.0"
> xmlns:xmi="reference"
> xmlns:xsi="reference"
> xmlns:form_ecore="reference"
> xsi:schemaLocation="reference">
> <hasPage title="Google" hasForm="//@form.0"/>
> <form name="Login" send_text="Buscar" hasInput="//@text.0
> //@combobox.0"/>
> <option value="1" display_text="1"/>
> <option value="2" display_text="2"/>
> <combobox name="tipo" label="Tipo" hasOption="//@option.0 //@option.1"/>
> <text name="Buscar"/>
> </form_ecore:Website>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Unresolved reference '//@class.1' [message #1726346 is a reply to message #1726284] Fri, 11 March 2016 15:21 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You only provide 25% of a repro so your problem looks implausible.

Try opening and validating your file with the Sample Reflective Ecore
Editor which is always a good arbiter of whether model producer or model
consumer is at fault.

Regards

Ed Willink



On 11/03/2016 13:22, Zuriel Morales wrote:
> We have a model and an Acceleo template to transform that model into
> web code.
>
> The problem is that, in the model, the children of each element are
> ordered like this: 'hasOption="//@option.0 //@option.1 //@option.2
> //@option.3"/>' and so on.
>
> When trying to generate code from these models, we get an "Unresolved
> reference '//@option.1'" error, but it works fine if we reverse the
> order manually (like this: 'hasOption="//@option.3 //@option.2
> //@option.1 //@option.0"/>').
>
> Is there a way we can get Acceleo to read the elements in the
> correct/opposite order?
>
> Here is an example of the model:
> <?xml version="1.0" encoding="UTF-8"?>
> <form_ecore:Website xmi:version="2.0"
> xmlns:xmi="reference"
> xmlns:xsi="reference"
> xmlns:form_ecore="reference"
> xsi:schemaLocation="reference">
> <hasPage title="Google" hasForm="//@form.0"/>
> <form name="Login" send_text="Buscar" hasInput="//@text.0
> //@combobox.0"/>
> <option value="1" display_text="1"/>
> <option value="2" display_text="2"/>
> <combobox name="tipo" label="Tipo" hasOption="//@option.0 //@option.1"/>
> <text name="Buscar"/>
> </form_ecore:Website>
Re: Unresolved reference '//@class.1' [message #1726410 is a reply to message #1726346] Sun, 13 March 2016 02:52 Go to previous message
Zuriel Morales is currently offline Zuriel MoralesFriend
Messages: 12
Registered: March 2016
Junior Member
We found it was indeed a problem with the Ecore model, though the error didn't show up when validating it with the Sample Reflective Ecore Editor. Thanks for your replies!
Previous Topic:UI data binding and EMF
Next Topic:Unique=false for EAttribute
Goto Forum:
  


Current Time: Thu Apr 25 14:12:45 GMT 2024

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

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

Back to the top