环境变量导致RTI XMLParser错误



我正在使用xml文件创建消息定义。

我的xml文件如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<dds>
<types>
<include file="home/a.shah/AR/rpc_types.xml"/>
<module name="idl">
<module name="test">
<module name="Calculator">
<struct name= "AdditionRequest" baseType="rpc::Request">
<member name="value1" type="int32"/>
<member name="value2" type="int32"/>
</struct>
<struct name= "AdditionReply" baseType="rpc::Reply">
<member name="result" type="int32"/>
</struct>
<struct name= "MultiplicationRequest" baseType="rpc::Request">
<member name="value1" type="int32"/>
<member name="value2" type="int32"/>
</struct>
<struct name= "MultiplicationReply" baseType="rpc::Reply">
<member name="result" type="int32"/>
</struct>
</module>
</module>
</module>
</types>
</dds>

我的$HOME环境设置为/home/a.shah,因此我想更换线路

<include file="home/a.shah/AR......"/>

<include file="$HOME/AR/......"/>

然而,当我这样做的时候,我会得到很多这样的错误:

DDS_XMLFileInfoList_assertFile:!open file: $HOME/AR/rpc_types.xml
DDS_XMLInclude_initialize:!assert file info DDS_XMLInclude_new:!init XML include object RTIXMLParser_onStartTag:Parse error at line 4: Error processing tag 'include' RTIXMLParser_parseFromFile_ex:Parse error in file 'tests/data/CalculatorService.xml' DDS_XMLParser_parse_from_file:Error parsing file
DDS_QosProvider_load_profiles_from_urlI:ERROR: loading profiles file 'tests/data/CalculatorService.xml' 
DDS_QosProvider_load_profiles_from_url_groupI:ERROR: loading profiles 
DDS_QosProvider_load_profiles_from_url_listI:ERROR: loading profiles DDS_QosProvider_load_profiles_from_env_varI: ERROR: loading profiles DDS_QosProvider_load_profilesI:ERROR: loading profiles DDS_DomainParticipantFactory_load_profilesI:!load profiles DDS_DomainParticipantFactory_get_default_participant_qos:ERROR: loading profiles

请告诉我如何在没有这些错误的情况下将/home/a.shah/AR更改为$HOME/AR

解决方案是使用类似的圆括号

<types>
<include file="$(HOME)/AR/ar-dds/idl/ar/dds/rpc/rpc_types.xml"/>
...
</types>

最新更新