P
paul.rusu
// start/stop trace
for $x in doc ($doc_name)/ProcessValueTrace/Trace,
$y in $x/StartTrace,
$z in $x/StopTrace
return
<Trace>
{ $y }
{ $z }
</Trace>
open/close logical link by name - input $logicallink_name
for $x in doc ($doc_name)/ProcessValueTrace/Trace,
$y in $x/OpenComPrimitive,
$t in $x/CloseComPrimitive
where (some $z in $y/LogicalLink satisfies
contains($z, string($logical_link_name)))
and (some $z2 in $t/LogicalLink satisfies
contains($z2, string($logical_link_name)) )
return
<Trace>
{ $y }
{ $t }
</Trace>
open/close comprimitive by name - input $comprimitive_name
for $x in doc ($doc_name)/ProcessValueTrace/Trace,
$y in $x/OpenComPrimitive,
$t in $x/CloseComPrimitive
where (contains($y/ShortName, string($comprimitive_name)))
and (contains($t/ShortName, string($comprimitive_name)))
return
<Trace>
{ $y }
{ $t }
</Trace>
let $request_ok:=false
if ($request_ok=true)
$y
else
""
result events - request - by pdu byte pattern (HEX) - input
$pdu_byte_pattern:string, $include_complete_result: boolean
let $doc_name:="can.xml"
let $include_complete_result:=true
let $pdu_byte_pattern:="1"
return
if ($include_complete_result=true) then
for $x in doc ($doc_name)/ProcessValueTrace/Trace
return
<Trace>
{
for $y in $x/DtsResult
let $bb:=for $xx in $y/DtsRequest where (contains($xx/PDU,
string($pdu_byte_pattern))) return $xx
return
if (not(empty($bb))) then
$y
else
""
}
</Trace>
else
for $x in doc ($doc_name)/ProcessValueTrace/Trace
return
<Trace>
{
for $y in $x/DtsResult
let $bb:=for $xx in $y/DtsRequest where (contains($xx/PDU,
string($pdu_byte_pattern))) return $xx
return
for $z in $y/DtsRequest
where (contains($z/PDU, string($pdu_byte_pattern)))
return
$z
}
</Trace>
if (empty($bb)) then
""
else
return
<DtsResult>
{ $y/LogicalLink }
{ $y/ComPrimitive }
if (empty($bb)) then
""
else
</DtsResult>
result events - request - parameter - by name - input
$parameter_name:string, $include_complete_result: boolean
let $doc_name:="can.xml"
let $include_complete_result:=true
let $parameter_name:="localID"
return
if ($include_complete_result=true) then
for $x in doc ($doc_name)/ProcessValueTrace/Trace
return
<Trace>
{
for $y in $x/DtsResult
let $bb:=for $xx in $y/DtsRequest,
$yy in $xx/DtsRequestParameter where (contains($yy/PDU,
string($parameter_name))) return $xx
return
if (not(empty($bb))) then
$y
else
""
}
</Trace>
else
for $x in doc ($doc_name)/ProcessValueTrace/Trace
return
<Trace>
{
for $y in $x/DtsResult
return
<DtsResult>
{ $y/LogicalLink }
{ $y/ComPrimitive }
{ for $z in $y/DtsRequest
where (contains($z/PDU, string($parameter_name)))
return
$z
}
</DtsResult>
}
</Trace>
for $x in doc ($doc_name)/ProcessValueTrace/Trace,
$y in $x/StartTrace,
$z in $x/StopTrace
return
<Trace>
{ $y }
{ $z }
</Trace>
open/close logical link by name - input $logicallink_name
for $x in doc ($doc_name)/ProcessValueTrace/Trace,
$y in $x/OpenComPrimitive,
$t in $x/CloseComPrimitive
where (some $z in $y/LogicalLink satisfies
contains($z, string($logical_link_name)))
and (some $z2 in $t/LogicalLink satisfies
contains($z2, string($logical_link_name)) )
return
<Trace>
{ $y }
{ $t }
</Trace>
open/close comprimitive by name - input $comprimitive_name
for $x in doc ($doc_name)/ProcessValueTrace/Trace,
$y in $x/OpenComPrimitive,
$t in $x/CloseComPrimitive
where (contains($y/ShortName, string($comprimitive_name)))
and (contains($t/ShortName, string($comprimitive_name)))
return
<Trace>
{ $y }
{ $t }
</Trace>
let $request_ok:=false
if ($request_ok=true)
$y
else
""
result events - request - by pdu byte pattern (HEX) - input
$pdu_byte_pattern:string, $include_complete_result: boolean
let $doc_name:="can.xml"
let $include_complete_result:=true
let $pdu_byte_pattern:="1"
return
if ($include_complete_result=true) then
for $x in doc ($doc_name)/ProcessValueTrace/Trace
return
<Trace>
{
for $y in $x/DtsResult
let $bb:=for $xx in $y/DtsRequest where (contains($xx/PDU,
string($pdu_byte_pattern))) return $xx
return
if (not(empty($bb))) then
$y
else
""
}
</Trace>
else
for $x in doc ($doc_name)/ProcessValueTrace/Trace
return
<Trace>
{
for $y in $x/DtsResult
let $bb:=for $xx in $y/DtsRequest where (contains($xx/PDU,
string($pdu_byte_pattern))) return $xx
return
for $z in $y/DtsRequest
where (contains($z/PDU, string($pdu_byte_pattern)))
return
$z
}
</Trace>
if (empty($bb)) then
""
else
return
<DtsResult>
{ $y/LogicalLink }
{ $y/ComPrimitive }
if (empty($bb)) then
""
else
</DtsResult>
result events - request - parameter - by name - input
$parameter_name:string, $include_complete_result: boolean
let $doc_name:="can.xml"
let $include_complete_result:=true
let $parameter_name:="localID"
return
if ($include_complete_result=true) then
for $x in doc ($doc_name)/ProcessValueTrace/Trace
return
<Trace>
{
for $y in $x/DtsResult
let $bb:=for $xx in $y/DtsRequest,
$yy in $xx/DtsRequestParameter where (contains($yy/PDU,
string($parameter_name))) return $xx
return
if (not(empty($bb))) then
$y
else
""
}
</Trace>
else
for $x in doc ($doc_name)/ProcessValueTrace/Trace
return
<Trace>
{
for $y in $x/DtsResult
return
<DtsResult>
{ $y/LogicalLink }
{ $y/ComPrimitive }
{ for $z in $y/DtsRequest
where (contains($z/PDU, string($parameter_name)))
return
$z
}
</DtsResult>
}
</Trace>