|
|
|
|
Re: Forcing xsi:type on the top level element [message #724968 is a reply to message #719095] |
Tue, 13 September 2011 15:50 |
Rob Mising name Messages: 118 Registered: July 2010 |
Senior Member |
|
|
Hi Ed,
Very sorry for going quiet - customer issues to look at have kept me busy for a little while!!
I appreciate you taking the time to reply. I have had a chance to look a little deeper into this. I spotted:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=296144
Which you put a fix into 2.6 for, unfortunately I am on 2.4.2 I have had a little go at patching this area on my test machine and have one question. With the additional if's that look as follows (there are two):
if (rootFeature != null && rootFeature.getEType() != eClassifier)
{
shouldSaveType = true;
}
it will force the xsi:type to be added if they are required for clarity, however, should it also ideally check to see if the OPTION_SAVE_TYPE_INFORMATION option has been set to enable "forcing" of xsi:type, something like:
if (rootFeature != null && ((xmlTypeInfo.shouldSaveType(eClass, rootFeature.getEType(), rootFeature)) ||(rootFeature.getEType() != eClassifier)) )
{
shouldSaveType = true;
}
The arguments are most probably completely wrong in my example and maybe also the logic, but I'm wondering if in this instance it should check to see if the xsi:type is being forced in some way?
Thanks
Rob
[Updated on: Tue, 13 September 2011 15:59] Report message to a moderator
|
|
|
Re: Forcing xsi:type on the top level element [message #724994 is a reply to message #724968] |
Tue, 13 September 2011 16:14 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Rob,
I suppose it should but it's hard to imagine ever wanting to force an
xsi:type on the root. Even this case looks like a poor schema design
that's better addressed by changing the schema than by using an xsi:type.
On 13/09/2011 8:50 AM, Rob wrote:
> Hi Ed,
>
> Very sorry for going quiet - customer issues to look at have kept me
> busy for a little while!!
>
> I appreciate you taking the time to reply. I have had a change to
> look a little deeper into this. I spotted:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=296144
>
> Which you put a fix into 2.6 for, unfortunately I am on 2.4.2 I have
> had a little go at patching this area on my test machine and have one
> question. With the additional if's that look as follows (there are two):
>
> if (rootFeature != null && rootFeature.getEType() != eClassifier)
> {
> shouldSaveType = true;
> }
>
> it will force the xsi:type to be added if they are required for
> clarity, however, should it also ideally check to see if the
> OPTION_SAVE_TYPE_INFORMATION option has been set to enable "forcing"
> of xsi:type, something like:
>
> if (rootFeature != null && ((xmlTypeInfo.shouldSaveType(eClass,
> rootFeature.getEType(), rootFeature)) ||(rootFeature.getEType() !=
> eClassifier)) ) {
> shouldSaveType = true;
> }
>
> The arguments are most probably completely wrong in my example and
> maybe also the logic, but I'm wondering if in this instance it should
> check to see if the xsi:type is being forced in some way?
>
> Thanks
>
> Rob
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03802 seconds