rakhimov / scram

Probabilistic Risk Analysis Tool (fault tree analysis, event tree analysis, etc.)
https://scram-pra.org
GNU General Public License v3.0
131 stars 54 forks source link

Failed to Include XML into another XML #284

Open gcfc opened 4 years ago

gcfc commented 4 years ago

Does SCRAM support referencing other XMLs in the input file? I tried to put the probabilities of basic events in a separate params.xml as follows:

<?xml version="1.0"?>
<define-basic-event name="BatteryFault">
    <float value="0.0001"/>
</define-basic-event>

In input.xml (at the same directory as params.xml), I tried to reference the params file as follows:

<?xml version="1.0"?>
<!DOCTYPE opsa-mef [
<!ENTITY params SYSTEM "params.xml">
]>
<opsa-mef>
  <define-fault-tree name="DroneFaultTree">
    <define-gate name="...">
    ...
    </define-gate>
    &params;
  </define-fault-tree>
</opsa-mef>

The error message that I got was:

scram::mef::ValidityError

File: /home/.../input.xml
Line: 106

Undefined event BatteryFault with base path DroneFaultTree

If it helps, my current SCRAM version is

SCRAM 0.16.2 ()

Dependencies:
   Boost       1_65_1
   libxml2     2.9.4

Line 106 is the event BatteryFault (one of the <or> arguments within <define-gate>). The "..." are in place for brevity.

@rakhimov Please let me know, thank you for your time!