Saving sub model...help! [message #415966] |
Mon, 14 January 2008 15:38 |
Eclipse User |
|
|
|
Originally posted by: minhyuk.kut.ac.kr
hi all^^;
i have very a huge model scheme(.xsd).
i try to driven all element, but i can't it's so complicate...
so, i have determine, developing editors and each editor driven sub-model and save each xml files finally project manager merge all together(export-menu export one xml file).
(it means, not editing xsd file, but just using sub element)
i have faced problem, when i saving the sub model.
the saved xml file is different my xsd scheme.
for example, element name is broken. like this
originally: (i want to saving this n_n)
<tc:pou xmlns:tc="http://abc.org/tc6.xsd" name="test">
<tc:body>
<tc:LD/>
</tc:body>
</tc:pou>
but:
<tc:pou_._type xmlns:tc="http://abc.org/tc6.xsd" name="test">
<tc:body>
<tc:LD/>
</tc:body>
</tc:pou_._type>
---- what option i can use? in XMLResource.
PS. do you know hide tc prefix? that's another problem!!
i really want to like this:
<pou name="test">
<body>
<LD/>
<body>
<pou>
|
|
|
Re: Saving sub model...help! [message #415967 is a reply to message #415966] |
Mon, 14 January 2008 16:01 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
MinHyuk,
Comments below.
MinHyuk wrote:
> hi all^^;
>
> i have very a huge model scheme(.xsd).
>
Poor you!
> i try to driven all element, but i can't it's so complicate...
>
"driven"?
> so, i have determine, developing editors and each editor driven sub-model and save each xml files finally project manager merge all together(export-menu export one xml file).
> (it means, not editing xsd file, but just using sub element)
>
So you're breaking things into multiple smaller files. I'm not sure you
need multiple different editors for that though...
> i have faced problem, when i saving the sub model.
> the saved xml file is different my xsd scheme.
>
> for example, element name is broken. like this
>
> originally: (i want to saving this n_n)
> <tc:pou xmlns:tc="http://abc.org/tc6.xsd" name="test">
> <tc:body>
> <tc:LD/>
> </tc:body>
> </tc:pou>
>
> but:
> <tc:pou_._type xmlns:tc="http://abc.org/tc6.xsd" name="test">
> <tc:body>
> <tc:LD/>
> </tc:body>
> </tc:pou_._type>
>
>
> ---- what option i can use? in XMLResource.
>
So it seems you are directly saving an instance of some anonymous type.
To serialize properly according to a global element you really need to
create an instance of the model's DocumentRoot and set your instance
into an appropriate feature corresponding to a global element
declaration. This is necessary to parse it properly later.
> PS. do you know hide tc prefix? that's another problem!!
> i really want to like this:
> <pou name="test">
> <body>
> <LD/>
> <body>
> <pou>
>
Again, you could use a document root for that. The document root has a
getXMLNSPrefixMap and you can do put ("", <namespace") to produce an
xmlns="..." declaration. It seems you me you do need to specify a
namespace not just leave it null...
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03293 seconds