我有 Xquery 的问题
我有一个这样的 XML 文档
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions .....">
<bpmn2:process id="process_3" drools:version="1" drools:packageName="defaultPackage"drools:adHoc="false" name="Default Process" isExecutable="true">
<bpmn2:startEvent id="StartEvent_1" name="">
<bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:endEvent id="EndEvent_1" name="">
<bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:sequenceFlow id="SequenceFlow_3" name="Sequence Flow 3" sourceRef="StartEvent_1" targetRef="ManualTask_1"/>
<bpmn2:manualTask id="ManualTask_1" timeToComplete="300" name="Manual Task 1">
<bpmn2:incoming>SequenceFlow_3</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
</bpmn2:manualTask>
<bpmn2:manualTask id="ManualTask_2" timeToComplete="200" name="Manual Task 2">
<bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
</bpmn2:manualTask>
<bpmn2:sequenceFlow id="SequenceFlow_1" name="Sequence Flow 1" sourceRef="ManualTask_1" targetRef="ManualTask_2"/>
<bpmn2:sequenceFlow id="SequenceFlow_4" name="Sequence Flow 4" sourceRef="ManualTask_2" targetRef="EndEvent_1"/>
</bpmn2:process>
</bpmn2:definitions>
我想获得下一个元素。(最后一个元素的传出序列流应该是传入元素(序列流)(因此是手动任务或 EndEvent (或作为其简化的不同的东西)(所有这些元素都有标签传入)
declare namespace bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL";
let $elements := doc('file:///C:\..\process3.txt')/bpmn2:definitions/bpmn2:process,
$e := $elements/bpmn2:startEvent
return $elements[//bpmn2:incoming/node() = $e//bpmn2:outgoing]
这在 BaseX 中返回的只是完整的 $elements 而不是 .. 目前我认为很难..