idl2xml conversion missing top-level ?

2 posts / 0 new
Last post
persan's picture
Offline
Last seen: 1 year 5 months ago
Joined: 08/11/2016
Posts: 2
idl2xml conversion missing top-level ?

Hi

The folowing idl:

module com {
const string TOPIC_COLORTHEMESTATUS = "ColorThemeStatus";
struct ColorThemeStatus {
long data; //@key
}; //@top-level
};

is generating an xml-file:

<?xml version="1.0" encoding="UTF-8"?>
<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/usr/dds/rti_connext_dds-5.2.3/bin/../resource/app/app_support/rtiddsgen/schema/rti_dds_topic_types.xsd">
<module name="com">
<const name="TOPIC_COLORTHEMESTATUS" type="string" value="&quot;ColorThemeStatus&quot;"/>
<struct name= "ColorThemeStatus">
<member name="data" type="long" key="true"/>
</struct>
</module>
</types>

But the 5.1 generator included a top-level tag as an attribute for the struct, is this intentional or is it a bug?

 

Organization:
Offline
Last seen: 10 months 3 weeks ago
Joined: 11/23/2016
Posts: 4

For the record, since we were discussing this topic on a support case, I'm going to add this information in this post as well.

The reason for this behavior is because by default, RTI Code Generator will generate user-level type-specific methods for all structures/unions found in an IDL/XML file. RTI Code Generator will generate the same code independently if the struct contains the topLevel attribute to true or if that is not the case.

That being said, the XSD file does not state true as the default value for the topLevel attribute, we have filed an issue report for this, but RTI Code Generator should works even if the XSD does not enforce such condition.

 Thanks,

Valentín