Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » new to JET2
new to JET2 [message #19947] Tue, 05 June 2007 07:42 Go to next message
Tex Twil is currently offline Tex Twil
Messages: 179
Registered: July 2009
Senior Member
Hello,
I'd like to use JET2 to generate a "custom" xml file from a xmi file
generated by GMF plugin. The input file is based on a GMF Tutorial and
looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<mindmap:map xmlns:mindmap="http://www.example.org/mindmap">
<rootTopics name="myTopic" subtopics="#//@map/@rootTopics.1">
<comments subject="myThread">
<items body="a ThreadI tem"/>
</comments>
</rootTopics>
<rootTopics name="AnotherTopic"/>
<rootTopics name="Third Topic"/>

<partitions name="Partition1"/>
<partitions name="Partition2"/>

</mindmap:map>

I'd like to iterate through the different elements to get their values. In
my template jet file I have :

<c:iterate select="/mindmap:map/rootTopics" var="currNode">
Name = <c:get select="$currNode/@name" />
</c:iterate>

But I obtain this error:
Error: No namespace URI found for prefix "mindmap"

The problem comes obviously from the "mindmap:map" tag but I don't know
the correct syntax to access its elements.

Thank you for your help.
Re: new to JET2 [message #20032 is a reply to message #19947] Tue, 05 June 2007 08:46 Go to previous messageGo to next message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Tex:

Try:

<c:iterate select="/map/rootTopics" var="currNode">
Name = <c:get select="$currNode/@name" />
</c:iterate>

JET doesn't currently have a mechanism to map namespace prefixes such as
'mindmap' to a namespace URI. To compensate, the relaxes the matching of
/map. Technically, it should not match mindmap:map, but it does.

Paul

"Tex Twil" <chaljan@hotmail.com> wrote in message
news:1d04f0fe4783c087432b0c6c80d4a244$1@www.eclipse.org...
> Hello,
> I'd like to use JET2 to generate a "custom" xml file from a xmi file
> generated by GMF plugin. The input file is based on a GMF Tutorial and
> looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <mindmap:map xmlns:mindmap="http://www.example.org/mindmap">
> <rootTopics name="myTopic" subtopics="#//@map/@rootTopics.1">
> <comments subject="myThread">
> <items body="a ThreadI tem"/>
> </comments>
> </rootTopics>
> <rootTopics name="AnotherTopic"/>
> <rootTopics name="Third Topic"/>
>
> <partitions name="Partition1"/>
> <partitions name="Partition2"/>
>
> </mindmap:map>
>
> I'd like to iterate through the different elements to get their values. In
> my template jet file I have :
>
> <c:iterate select="/mindmap:map/rootTopics" var="currNode"> Name = <c:get
> select="$currNode/@name" />
> </c:iterate>
> But I obtain this error:
> Error: No namespace URI found for prefix "mindmap"
>
> The problem comes obviously from the "mindmap:map" tag but I don't know
> the correct syntax to access its elements.
>
> Thank you for your help.
>
Re: new to JET2 [resolved] [message #20650 is a reply to message #20032] Tue, 05 June 2007 10:14 Go to previous message
Tex Twil is currently offline Tex Twil
Messages: 179
Registered: July 2009
Senior Member
Thank you Paul, it seems to work.

Paul Elder wrote:

> Tex:

> Try:

> <c:iterate select="/map/rootTopics" var="currNode">
> Name = <c:get select="$currNode/@name" />
> </c:iterate>

> JET doesn't currently have a mechanism to map namespace prefixes such as
> 'mindmap' to a namespace URI. To compensate, the relaxes the matching of
> /map. Technically, it should not match mindmap:map, but it does.

> Paul

> "Tex Twil" <chaljan@hotmail.com> wrote in message
> news:1d04f0fe4783c087432b0c6c80d4a244$1@www.eclipse.org...
>> Hello,
>> I'd like to use JET2 to generate a "custom" xml file from a xmi file
>> generated by GMF plugin. The input file is based on a GMF Tutorial and
>> looks like this:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <mindmap:map xmlns:mindmap="http://www.example.org/mindmap">
>> <rootTopics name="myTopic" subtopics="#//@map/@rootTopics.1">
>> <comments subject="myThread">
>> <items body="a ThreadI tem"/>
>> </comments>
>> </rootTopics>
>> <rootTopics name="AnotherTopic"/>
>> <rootTopics name="Third Topic"/>
>>
>> <partitions name="Partition1"/>
>> <partitions name="Partition2"/>
>>
>> </mindmap:map>
>>
>> I'd like to iterate through the different elements to get their values. In
>> my template jet file I have :
>>
>> <c:iterate select="/mindmap:map/rootTopics" var="currNode"> Name = <c:get
>> select="$currNode/@name" />
>> </c:iterate>
>> But I obtain this error:
>> Error: No namespace URI found for prefix "mindmap"
>>
>> The problem comes obviously from the "mindmap:map" tag but I don't know
>> the correct syntax to access its elements.
>>
>> Thank you for your help.
>>
Previous Topic:JET2 access to ecore references... again
Next Topic:Re: creating a jet project
Goto Forum:
  


Current Time: Thu Jul 31 13:35:45 EDT 2014

Powered by FUDForum. Page generated in 0.11967 seconds