Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL]problem in something2XML transformation
[ATL]problem in something2XML transformation [message #53515] Thu, 19 July 2007 14:28 Go to next message
stephen Yu is currently offline stephen YuFriend
Messages: 35
Registered: July 2009
Member
Hi,

After I get target.ecore file from a transformation, for example,
source.ecore--->confirm to--->sourceMM.ecore
target.ecore--->confirm to--->targetMM.ecore
transformation file:source2target.atl
after this transformation, I get target.ecore like:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns="http://esit.hp.com/0.1/models/argumentsModel">
<OpcnodeArgu groupName="CTO" nodeName="www.ali88.com"
nodeLabel="www.ali88.com"
netType="VPN" machType="Windows XP" ipAddress="2.2.2.2"/>
<OpcnodeArgu groupName="CTO" nodeName="www.ali88.com"
nodeLabel="www.ali88.com"
netType="VPN" machType="Windows XP" ipAddress="2.2.2.2"/>
</xmi:XMI>

Now I want to transform it to an XML file
target.ecore--->confirm to--->targetMM.ecore
xmlfile.ecore--->confirm to--->XMLMM.ecore
transformation file:target2xml.atl

My question is how to handle the namespace?
I want to put the [xmlns="http://esit.hp.com/0.1/models/argumentsModel"]
into the xmlfile.ecore.
However, after target2xml transformation, the xmlfile.ecore I get is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="XML">
<Root name="OpcnodeArgu">
<children xsi:type="Element" name="groupName">
<children xsi:type="Text" value="CTO"/>
</children>
<children xsi:type="Element" name="nodeName">
<children xsi:type="Text" value="www.ali88.com"/>
</children>
<children xsi:type="Element" name="nodeLabel">
<children xsi:type="Text" value="www.ali88.com"/>
</children>
<children xsi:type="Element" name="netType">
<children xsi:type="Text" value="VPN"/>
</children>
<children xsi:type="Element" name="machType">
<children xsi:type="Text" value="Windows XP"/>
</children>
<children xsi:type="Element" name="ipAddress">
<children xsi:type="Text" value="2.2.2.2"/>
</children>
</Root>
<Root name="OpcnodeArgu">
<children xsi:type="Element" name="groupName">
<children xsi:type="Text" value="CTO"/>
</children>
<children xsi:type="Element" name="nodeName">
<children xsi:type="Text" value="www.ali88.com"/>
</children>
<children xsi:type="Element" name="nodeLabel">
<children xsi:type="Text" value="www.ali88.com"/>
</children>
<children xsi:type="Element" name="netType">
<children xsi:type="Text" value="VPN"/>
</children>
<children xsi:type="Element" name="machType">
<children xsi:type="Text" value="Windows XP"/>
</children>
<children xsi:type="Element" name="ipAddress">
<children xsi:type="Text" value="2.2.2.2"/>
</children>
</Root>
</xmi:XMI>

As you see, xmlns="http://esit.hp.com/0.1/models/argumentsModel" is lost.
My question is how to keep
xmlns="http://esit.hp.com/0.1/models/argumentsModel" in the xmlfile.ecore
after target2xml transformation?
Re: [ATL]problem in something2XML transformation [message #54085 is a reply to message #53515] Fri, 20 July 2007 16:22 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
sfyu a écrit :
> Hi,
>
> After I get target.ecore file from a transformation, for example,
> source.ecore--->confirm to--->sourceMM.ecore
> target.ecore--->confirm to--->targetMM.ecore
> transformation file:source2target.atl
> after this transformation, I get target.ecore like:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xmi:XMI xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns="http://esit.hp.com/0.1/models/argumentsModel">
> <OpcnodeArgu groupName="CTO" nodeName="www.ali88.com"
> nodeLabel="www.ali88.com"
> netType="VPN" machType="Windows XP" ipAddress="2.2.2.2"/>
> <OpcnodeArgu groupName="CTO" nodeName="www.ali88.com"
> nodeLabel="www.ali88.com"
> netType="VPN" machType="Windows XP" ipAddress="2.2.2.2"/>
> </xmi:XMI>
>
> Now I want to transform it to an XML file
> target.ecore--->confirm to--->targetMM.ecore
> xmlfile.ecore--->confirm to--->XMLMM.ecore
> transformation file:target2xml.atl
>
> My question is how to handle the namespace?
> I want to put the [xmlns="http://esit.hp.com/0.1/models/argumentsModel"]
> into the xmlfile.ecore.
> However, after target2xml transformation, the xmlfile.ecore I get is:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xmi:XMI xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="XML">
> <Root name="OpcnodeArgu">
> <children xsi:type="Element" name="groupName">
> <children xsi:type="Text" value="CTO"/>
> </children>
> <children xsi:type="Element" name="nodeName">
> <children xsi:type="Text" value="www.ali88.com"/>
> </children>
> <children xsi:type="Element" name="nodeLabel">
> <children xsi:type="Text" value="www.ali88.com"/>
> </children>
> <children xsi:type="Element" name="netType">
> <children xsi:type="Text" value="VPN"/>
> </children>
> <children xsi:type="Element" name="machType">
> <children xsi:type="Text" value="Windows XP"/>
> </children>
> <children xsi:type="Element" name="ipAddress">
> <children xsi:type="Text" value="2.2.2.2"/>
> </children>
> </Root>
> <Root name="OpcnodeArgu">
> <children xsi:type="Element" name="groupName">
> <children xsi:type="Text" value="CTO"/>
> </children>
> <children xsi:type="Element" name="nodeName">
> <children xsi:type="Text" value="www.ali88.com"/>
> </children>
> <children xsi:type="Element" name="nodeLabel">
> <children xsi:type="Text" value="www.ali88.com"/>
> </children>
> <children xsi:type="Element" name="netType">
> <children xsi:type="Text" value="VPN"/>
> </children>
> <children xsi:type="Element" name="machType">
> <children xsi:type="Text" value="Windows XP"/>
> </children>
> <children xsi:type="Element" name="ipAddress">
> <children xsi:type="Text" value="2.2.2.2"/>
> </children>
> </Root>
> </xmi:XMI>
>
> As you see, xmlns="http://esit.hp.com/0.1/models/argumentsModel" is lost.
> My question is how to keep
> xmlns="http://esit.hp.com/0.1/models/argumentsModel" in the xmlfile.ecore
> after target2xml transformation?
>
>
>
Hi,

I think you are missing a step in your process : your output file is
still into xmi format, and you need to use the XML extraction to get the
correct xml file (AM3 perspective, then right-click on file, extract
XML model to XML file).

For the missing xmlns problem, you need to manually create (in the
target2xml transformation) a chidren under the root XML element.

Regards,
William Piers
MDA Consultant, Obeo (http://www.obeo.fr)
Re: [ATL]problem in something2XML transformation [message #54192 is a reply to message #54085] Sun, 22 July 2007 12:45 Go to previous messageGo to next message
stephen Yu is currently offline stephen YuFriend
Messages: 35
Registered: July 2009
Member
Hi William,

Thanks for your help.
1) I omitted the XML extraction step in my previous post, so the output is
still in XMI format, but it does not matter.
2) Just as you mentioned, in order to keep the namespace information,I have
to manually create (in the target2xml transformation) a chidren wich value
"http://esit.hp.com/0.1/models/argumentsModel" under the root XML element.
But this solution does not sound good because I have to hard code the
namespace "http://esit.hp.com/0.1/models/argumentsModel" in the atl file. In
fact, the namespace information can be extracted from the source model file.
That is, the namespace has already existed in target.ecore, when I do
target2xml transformation, I'd better get the namespace from target.ecore
file and put it in xmlfile.ecore.

Is it possible to do that?

Stephen Yu.

"William Piers" <william.piers@obeo.fr> wrote in message
news:f7qnh1$33d$1@build.eclipse.org...
> sfyu a
Re: [ATL]problem in something2XML transformation [message #54270 is a reply to message #54192] Mon, 23 July 2007 09:00 Go to previous messageGo to next message
William Piers is currently offline William PiersFriend
Messages: 297
Registered: July 2009
Senior Member
Hi,
I don't think it's possible to get the namespace information in the ATL
transformation. Hard coding the namespace in the transformation may be
the best solution for what you want to do.

But I don't understand why you want to put the targetMM namespace in the
output xml file. I explain :
- The target.ecore file conforms to the targetMM metamodel, so the xmi
file contains a reference to the metamodel (the namespace
"http://esit.hp.com/0.1/models/argumentsModel").
- When you create the xmlfile.ecore, it is conforming to the XML
metamodel, so the namespace becomes XML.


> Hi William,
>
> Thanks for your help.
> 1) I omitted the XML extraction step in my previous post, so the output is
> still in XMI format, but it does not matter.
> 2) Just as you mentioned, in order to keep the namespace information,I have
> to manually create (in the target2xml transformation) a chidren wich value
> "http://esit.hp.com/0.1/models/argumentsModel" under the root XML element.
> But this solution does not sound good because I have to hard code the
> namespace "http://esit.hp.com/0.1/models/argumentsModel" in the atl file. In
> fact, the namespace information can be extracted from the source model file.
> That is, the namespace has already existed in target.ecore, when I do
> target2xml transformation, I'd better get the namespace from target.ecore
> file and put it in xmlfile.ecore.
>
> Is it possible to do that?
>
> Stephen Yu.
>
> "William Piers" <william.piers@obeo.fr> wrote in message
> news:f7qnh1$33d$1@build.eclipse.org...
>> sfyu a écrit :
>>> Hi,
>>>
>>> After I get target.ecore file from a transformation, for example,
>>> source.ecore--->confirm to--->sourceMM.ecore
>>> target.ecore--->confirm to--->targetMM.ecore
>>> transformation file:source2target.atl
>>> after this transformation, I get target.ecore like:
>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>> <xmi:XMI xmi:version="2.0"
>>> xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns="http://esit.hp.com/0.1/models/argumentsModel">
>>> <OpcnodeArgu groupName="CTO" nodeName="www.ali88.com"
>>> nodeLabel="www.ali88.com"
>>> netType="VPN" machType="Windows XP" ipAddress="2.2.2.2"/>
>>> <OpcnodeArgu groupName="CTO" nodeName="www.ali88.com"
>>> nodeLabel="www.ali88.com"
>>> netType="VPN" machType="Windows XP" ipAddress="2.2.2.2"/>
>>> </xmi:XMI>
>>>
>>> Now I want to transform it to an XML file
>>> target.ecore--->confirm to--->targetMM.ecore
>>> xmlfile.ecore--->confirm to--->XMLMM.ecore
>>> transformation file:target2xml.atl
>>>
>>> My question is how to handle the namespace?
>>> I want to put the [xmlns="http://esit.hp.com/0.1/models/argumentsModel"]
>>> into the xmlfile.ecore.
>>> However, after target2xml transformation, the xmlfile.ecore I get is:
>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>> <xmi:XMI xmi:version="2.0"
>>> xmlns:xmi="http://www.omg.org/XMI"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns="XML">
>>> <Root name="OpcnodeArgu">
>>> <children xsi:type="Element" name="groupName">
>>> <children xsi:type="Text" value="CTO"/>
>>> </children>
>>> <children xsi:type="Element" name="nodeName">
>>> <children xsi:type="Text" value="www.ali88.com"/>
>>> </children>
>>> <children xsi:type="Element" name="nodeLabel">
>>> <children xsi:type="Text" value="www.ali88.com"/>
>>> </children>
>>> <children xsi:type="Element" name="netType">
>>> <children xsi:type="Text" value="VPN"/>
>>> </children>
>>> <children xsi:type="Element" name="machType">
>>> <children xsi:type="Text" value="Windows XP"/>
>>> </children>
>>> <children xsi:type="Element" name="ipAddress">
>>> <children xsi:type="Text" value="2.2.2.2"/>
>>> </children>
>>> </Root>
>>> <Root name="OpcnodeArgu">
>>> <children xsi:type="Element" name="groupName">
>>> <children xsi:type="Text" value="CTO"/>
>>> </children>
>>> <children xsi:type="Element" name="nodeName">
>>> <children xsi:type="Text" value="www.ali88.com"/>
>>> </children>
>>> <children xsi:type="Element" name="nodeLabel">
>>> <children xsi:type="Text" value="www.ali88.com"/>
>>> </children>
>>> <children xsi:type="Element" name="netType">
>>> <children xsi:type="Text" value="VPN"/>
>>> </children>
>>> <children xsi:type="Element" name="machType">
>>> <children xsi:type="Text" value="Windows XP"/>
>>> </children>
>>> <children xsi:type="Element" name="ipAddress">
>>> <children xsi:type="Text" value="2.2.2.2"/>
>>> </children>
>>> </Root>
>>> </xmi:XMI>
>>>
>>> As you see, xmlns="http://esit.hp.com/0.1/models/argumentsModel" is lost.
>>> My question is how to keep
>>> xmlns="http://esit.hp.com/0.1/models/argumentsModel" in the xmlfile.ecore
>>> after target2xml transformation?
>>>
>>>
>>>
>> Hi,
>>
>> I think you are missing a step in your process : your output file is still
>> into xmi format, and you need to use the XML extraction to get the correct
>> xml file (AM3 perspective, then right-click on file, extract XML model to
>> XML file).
>>
>> For the missing xmlns problem, you need to manually create (in the
>> target2xml transformation) a chidren under the root XML element.
>>
>> Regards,
>> William Piers
>> MDA Consultant, Obeo (http://www.obeo.fr)
>
>
Re: [ATL]problem in something2XML transformation [message #54324 is a reply to message #54270] Mon, 23 July 2007 09:24 Go to previous messageGo to next message
stephen Yu is currently offline stephen YuFriend
Messages: 35
Registered: July 2009
Member
Hi,
I want to keep the targetMM namespace in the out xml file becaue JAXB
requires this. The out put xml file(after xml data extraction) is the
input of JAXB program which will unmarshall the xml data to a java object.

Stephen Yu.


William Piers wrote:

> Hi,
> I don't think it's possible to get the namespace information in the ATL
> transformation. Hard coding the namespace in the transformation may be
> the best solution for what you want to do.

> But I don't understand why you want to put the targetMM namespace in the
> output xml file. I explain :
> - The target.ecore file conforms to the targetMM metamodel, so the xmi
> file contains a reference to the metamodel (the namespace
> "http://esit.hp.com/0.1/models/argumentsModel").
> - When you create the xmlfile.ecore, it is conforming to the XML
> metamodel, so the namespace becomes XML.


>> Hi William,
>>
>> Thanks for your help.
>> 1) I omitted the XML extraction step in my previous post, so the output is
>> still in XMI format, but it does not matter.
>> 2) Just as you mentioned, in order to keep the namespace information,I have
>> to manually create (in the target2xml transformation) a chidren wich value
>> "http://esit.hp.com/0.1/models/argumentsModel" under the root XML element.
>> But this solution does not sound good because I have to hard code the
>> namespace "http://esit.hp.com/0.1/models/argumentsModel" in the atl file.
In
>> fact, the namespace information can be extracted from the source model file.
>> That is, the namespace has already existed in target.ecore, when I do
>> target2xml transformation, I'd better get the namespace from target.ecore
>> file and put it in xmlfile.ecore.
>>
>> Is it possible to do that?
>>
>> Stephen Yu.
>>
>> "William Piers" <william.piers@obeo.fr> wrote in message
>> news:f7qnh1$33d$1@build.eclipse.org...
>>> sfyu a écrit :
>>>> Hi,
>>>>
>>>> After I get target.ecore file from a transformation, for example,
>>>> source.ecore--->confirm to--->sourceMM.ecore
>>>> target.ecore--->confirm to--->targetMM.ecore
>>>> transformation file:source2target.atl
>>>> after this transformation, I get target.ecore like:
>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>> <xmi:XMI xmi:version="2.0"
>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>> xmlns="http://esit.hp.com/0.1/models/argumentsModel">
>>>> <OpcnodeArgu groupName="CTO" nodeName="www.ali88.com"
>>>> nodeLabel="www.ali88.com"
>>>> netType="VPN" machType="Windows XP" ipAddress="2.2.2.2"/>
>>>> <OpcnodeArgu groupName="CTO" nodeName="www.ali88.com"
>>>> nodeLabel="www.ali88.com"
>>>> netType="VPN" machType="Windows XP" ipAddress="2.2.2.2"/>
>>>> </xmi:XMI>
>>>>
>>>> Now I want to transform it to an XML file
>>>> target.ecore--->confirm to--->targetMM.ecore
>>>> xmlfile.ecore--->confirm to--->XMLMM.ecore
>>>> transformation file:target2xml.atl
>>>>
>>>> My question is how to handle the namespace?
>>>> I want to put the [xmlns="http://esit.hp.com/0.1/models/argumentsModel"]
>>>> into the xmlfile.ecore.
>>>> However, after target2xml transformation, the xmlfile.ecore I get is:
>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>> <xmi:XMI xmi:version="2.0"
>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xmlns="XML">
>>>> <Root name="OpcnodeArgu">
>>>> <children xsi:type="Element" name="groupName">
>>>> <children xsi:type="Text" value="CTO"/>
>>>> </children>
>>>> <children xsi:type="Element" name="nodeName">
>>>> <children xsi:type="Text" value="www.ali88.com"/>
>>>> </children>
>>>> <children xsi:type="Element" name="nodeLabel">
>>>> <children xsi:type="Text" value="www.ali88.com"/>
>>>> </children>
>>>> <children xsi:type="Element" name="netType">
>>>> <children xsi:type="Text" value="VPN"/>
>>>> </children>
>>>> <children xsi:type="Element" name="machType">
>>>> <children xsi:type="Text" value="Windows XP"/>
>>>> </children>
>>>> <children xsi:type="Element" name="ipAddress">
>>>> <children xsi:type="Text" value="2.2.2.2"/>
>>>> </children>
>>>> </Root>
>>>> <Root name="OpcnodeArgu">
>>>> <children xsi:type="Element" name="groupName">
>>>> <children xsi:type="Text" value="CTO"/>
>>>> </children>
>>>> <children xsi:type="Element" name="nodeName">
>>>> <children xsi:type="Text" value="www.ali88.com"/>
>>>> </children>
>>>> <children xsi:type="Element" name="nodeLabel">
>>>> <children xsi:type="Text" value="www.ali88.com"/>
>>>> </children>
>>>> <children xsi:type="Element" name="netType">
>>>> <children xsi:type="Text" value="VPN"/>
>>>> </children>
>>>> <children xsi:type="Element" name="machType">
>>>> <children xsi:type="Text" value="Windows XP"/>
>>>> </children>
>>>> <children xsi:type="Element" name="ipAddress">
>>>> <children xsi:type="Text" value="2.2.2.2"/>
>>>> </children>
>>>> </Root>
>>>> </xmi:XMI>
>>>>
>>>> As you see, xmlns="http://esit.hp.com/0.1/models/argumentsModel" is lost.
>>>> My question is how to keep
>>>> xmlns="http://esit.hp.com/0.1/models/argumentsModel" in the xmlfile.ecore
>>>> after target2xml transformation?
>>>>
>>>>
>>>>
>>> Hi,
>>>
>>> I think you are missing a step in your process : your output file is still
>>> into xmi format, and you need to use the XML extraction to get the correct
>>> xml file (AM3 perspective, then right-click on file, extract XML model to
>>> XML file).
>>>
>>> For the missing xmlns problem, you need to manually create (in the
>>> target2xml transformation) a chidren under the root XML element.
>>>
>>> Regards,
>>> William Piers
>>> MDA Consultant, Obeo (http://www.obeo.fr)
>>
>>
Re: [ATL]problem in something2XML transformation [message #54933 is a reply to message #54324] Thu, 26 July 2007 12:21 Go to previous message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

Firstly, I understand that JAXB needs a specific namespace URI. However,
I do not believe that this URI should be the same as the one used for
the metamodel: the XMI file and the actual JAXB files do not have the
same schema.

Secondly, if you do not want to hardcode the namespace URI in your
transformation, you may provide it in one of the source models. One
possibility would be to add an additional "configuration" source models
containing such information.


Regards,

Frédéric Jouault

Stephen Yu wrote:
> Hi,
> I want to keep the targetMM namespace in the out xml file becaue JAXB
> requires this. The out put xml file(after xml data extraction) is the
> input of JAXB program which will unmarshall the xml data to a java object.
>
> Stephen Yu.
>
>
> William Piers wrote:
>
>> Hi,
>> I don't think it's possible to get the namespace information in the
>> ATL transformation. Hard coding the namespace in the transformation
>> may be the best solution for what you want to do.
>
>> But I don't understand why you want to put the targetMM namespace in
>> the output xml file. I explain :
>> - The target.ecore file conforms to the targetMM metamodel, so the xmi
>> file contains a reference to the metamodel (the namespace
>> "http://esit.hp.com/0.1/models/argumentsModel").
>> - When you create the xmlfile.ecore, it is conforming to the XML
>> metamodel, so the namespace becomes XML.
>
>
>>> Hi William,
>>>
>>> Thanks for your help.
>>> 1) I omitted the XML extraction step in my previous post, so the
>>> output is still in XMI format, but it does not matter.
>>> 2) Just as you mentioned, in order to keep the namespace
>>> information,I have to manually create (in the target2xml
>>> transformation) a chidren wich value
>>> "http://esit.hp.com/0.1/models/argumentsModel" under the root XML
>>> element.
>>> But this solution does not sound good because I have to hard code the
>>> namespace "http://esit.hp.com/0.1/models/argumentsModel" in the atl
>>> file.
> In
>>> fact, the namespace information can be extracted from the source
>>> model file.
>>> That is, the namespace has already existed in target.ecore, when I do
>>> target2xml transformation, I'd better get the namespace from
>>> target.ecore file and put it in xmlfile.ecore.
>>>
>>> Is it possible to do that?
>>>
>>> Stephen Yu.
>>>
>>> "William Piers" <william.piers@obeo.fr> wrote in message
>>> news:f7qnh1$33d$1@build.eclipse.org...
>>>> sfyu a écrit :
>>>>> Hi,
>>>>>
>>>>> After I get target.ecore file from a transformation, for example,
>>>>> source.ecore--->confirm to--->sourceMM.ecore
>>>>> target.ecore--->confirm to--->targetMM.ecore
>>>>> transformation file:source2target.atl
>>>>> after this transformation, I get target.ecore like:
>>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>>> <xmi:XMI xmi:version="2.0"
>>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>>> xmlns="http://esit.hp.com/0.1/models/argumentsModel">
>>>>> <OpcnodeArgu groupName="CTO" nodeName="www.ali88.com"
>>>>> nodeLabel="www.ali88.com"
>>>>> netType="VPN" machType="Windows XP" ipAddress="2.2.2.2"/>
>>>>> <OpcnodeArgu groupName="CTO" nodeName="www.ali88.com"
>>>>> nodeLabel="www.ali88.com"
>>>>> netType="VPN" machType="Windows XP" ipAddress="2.2.2.2"/>
>>>>> </xmi:XMI>
>>>>>
>>>>> Now I want to transform it to an XML file
>>>>> target.ecore--->confirm to--->targetMM.ecore
>>>>> xmlfile.ecore--->confirm to--->XMLMM.ecore
>>>>> transformation file:target2xml.atl
>>>>>
>>>>> My question is how to handle the namespace?
>>>>> I want to put the
>>>>> [xmlns="http://esit.hp.com/0.1/models/argumentsModel"] into the
>>>>> xmlfile.ecore.
>>>>> However, after target2xml transformation, the xmlfile.ecore I get is:
>>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>>> <xmi:XMI xmi:version="2.0"
>>>>> xmlns:xmi="http://www.omg.org/XMI"
>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>> xmlns="XML">
>>>>> <Root name="OpcnodeArgu">
>>>>> <children xsi:type="Element" name="groupName">
>>>>> <children xsi:type="Text" value="CTO"/>
>>>>> </children>
>>>>> <children xsi:type="Element" name="nodeName">
>>>>> <children xsi:type="Text" value="www.ali88.com"/>
>>>>> </children>
>>>>> <children xsi:type="Element" name="nodeLabel">
>>>>> <children xsi:type="Text" value="www.ali88.com"/>
>>>>> </children>
>>>>> <children xsi:type="Element" name="netType">
>>>>> <children xsi:type="Text" value="VPN"/>
>>>>> </children>
>>>>> <children xsi:type="Element" name="machType">
>>>>> <children xsi:type="Text" value="Windows XP"/>
>>>>> </children>
>>>>> <children xsi:type="Element" name="ipAddress">
>>>>> <children xsi:type="Text" value="2.2.2.2"/>
>>>>> </children>
>>>>> </Root>
>>>>> <Root name="OpcnodeArgu">
>>>>> <children xsi:type="Element" name="groupName">
>>>>> <children xsi:type="Text" value="CTO"/>
>>>>> </children>
>>>>> <children xsi:type="Element" name="nodeName">
>>>>> <children xsi:type="Text" value="www.ali88.com"/>
>>>>> </children>
>>>>> <children xsi:type="Element" name="nodeLabel">
>>>>> <children xsi:type="Text" value="www.ali88.com"/>
>>>>> </children>
>>>>> <children xsi:type="Element" name="netType">
>>>>> <children xsi:type="Text" value="VPN"/>
>>>>> </children>
>>>>> <children xsi:type="Element" name="machType">
>>>>> <children xsi:type="Text" value="Windows XP"/>
>>>>> </children>
>>>>> <children xsi:type="Element" name="ipAddress">
>>>>> <children xsi:type="Text" value="2.2.2.2"/>
>>>>> </children>
>>>>> </Root>
>>>>> </xmi:XMI>
>>>>>
>>>>> As you see, xmlns="http://esit.hp.com/0.1/models/argumentsModel" is
>>>>> lost.
>>>>> My question is how to keep
>>>>> xmlns="http://esit.hp.com/0.1/models/argumentsModel" in the
>>>>> xmlfile.ecore after target2xml transformation?
>>>>>
>>>>>
>>>>>
>>>> Hi,
>>>>
>>>> I think you are missing a step in your process : your output file is
>>>> still into xmi format, and you need to use the XML extraction to get
>>>> the correct xml file (AM3 perspective, then right-click on file,
>>>> extract XML model to XML file).
>>>>
>>>> For the missing xmlns problem, you need to manually create (in the
>>>> target2xml transformation) a chidren under the root XML element.
>>>>
>>>> Regards,
>>>> William Piers
>>>> MDA Consultant, Obeo (http://www.obeo.fr)
>>>
>>>
>
>
Previous Topic:Error 'AM3Repository' is not legal
Next Topic:[ATL] Re: feature e does not exist on
Goto Forum:
  


Current Time: Tue Jan 19 22:01:23 GMT 2021

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

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

Back to the top