在多个xml文件上拆分SCXML

在多个xml文件上拆分SCXML,xml,qt,qt5,scxml,qxmlstreamreader,Xml,Qt,Qt5,Scxml,Qxmlstreamreader,我正在创建不同的SCXML文件,然后由Qt应用程序使用。为了更好地构造我的状态机,我想将一台机器的公共部分与其他每台机器的自定义状态分开。所以我想把我的状态机分成两个文件 父文件:parentStateMachine.scxml <?xml version="1.0" encoding="UTF-8"?> <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" binding="ear

我正在创建不同的SCXML文件,然后由Qt应用程序使用。为了更好地构造我的状态机,我想将一台机器的公共部分与其他每台机器的自定义状态分开。所以我想把我的状态机分成两个文件

父文件:parentStateMachine.scxml

<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml"
       version="1.0"
       binding="early"
       xmlns:qt="http://www.qt.io/2015/02/scxml-ext"
       name="MyStatemachine.scxml"
       qt:editorversion="4.2.2"
       datamodel="ecmascript"
       initial="s1"
       xmlns:xi="http://www.w3.org/2001/XInclude">
    <state id="init">
        <transition type="external" event="prepare" target="configure"/>
    </state>
    <state id="configure">
        <transition type="external" event="start" target="run"/>
    </state>
    <parallel id="run">
        <!-- include here application specific states-->
        <transition type="external" event="stop" target="end"/>
    </parallel>
    <final id="end">
    </final>
</scxml>
<state id="applicationSpecificState1"/>
<state id="applicationSpecificState2"/>
<state id="applicationSpecificState3"/>

特定于应用程序:applicationSpecific1.scxml

<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml"
       version="1.0"
       binding="early"
       xmlns:qt="http://www.qt.io/2015/02/scxml-ext"
       name="MyStatemachine.scxml"
       qt:editorversion="4.2.2"
       datamodel="ecmascript"
       initial="s1"
       xmlns:xi="http://www.w3.org/2001/XInclude">
    <state id="init">
        <transition type="external" event="prepare" target="configure"/>
    </state>
    <state id="configure">
        <transition type="external" event="start" target="run"/>
    </state>
    <parallel id="run">
        <!-- include here application specific states-->
        <transition type="external" event="stop" target="end"/>
    </parallel>
    <final id="end">
    </final>
</scxml>
<state id="applicationSpecificState1"/>
<state id="applicationSpecificState2"/>
<state id="applicationSpecificState3"/>

我已尝试通过两种方式将特定于应用程序的内容包含在父应用程序中:

  • 我尝试插入
    而不是注释

  • 我尝试在
    xml
    标记之后添加
    ,然后添加
    &innerFile而不是注释

  • 当我加载文档时,它们被解析得很好,但从行为上我可以推断,它没有考虑特定于应用程序的scxml中定义的任何内容

    PS: 我发现了这个旧的未解决的bug报告,我希望它已经解决了。

    我可以用Qt 5.10验证相同的行为。SCXML规范给出了一个如何执行此操作的示例:。但不幸的是,Qt似乎还不支持这一点。