Priscilla,
You've been so helpfull.
1)I tried to apply the "typeswitch " thing you showed me but it's now
working.
I have syntax problems when it comes to if (cond) return $x.
Here is my code. You don't have to understand it just please look at
the typeswitch ($y) case element(..) if (cond) then $x else ( )
From a working code I just changed "for .. where .." to "case elment
(..) return if (....) then .. else..". So for each case element the
"return if " sintax is the problem.
2)Also can you give me a complete short example on a sample xml of the
condition negation with "let" you wrote about in the last email.
let $doc_name:="can.xml"
let $exclude_items:=0
let $after_startstoptrace:=0
let $after_comprimitive_logicallink_name:=0
let $after_comprimitive_name:=0
let $after_comprimitive_id:=0
let $logical_link_name:="CAN1.DiagCan"
let $include_complete_result_pdu_request:=0
let $include_complete_result_parameter_value_request:=0
let $include_complete_result_parameter_type_request:=0
let $include_complete_result_parameter_name_request:=0
let $include_complete_result_error_code_request:=0
let $include_complete_result_error_severity_request:=0
let $include_complete_result_pdu_response:=0
let $include_complete_result_parameter_value_response:=0
let $include_complete_result_parameter_type_response:=0
let $include_complete_result_parameter_name_response:=0
let $include_complete_result_error_code_response:=0
let $include_complete_result_error_severity_response:=0
let $include_complete_result_pdu_both:=0
let $include_complete_result_parameter_value_both:=0
let $include_complete_result_parameter_type_both:=0
let $include_complete_result_parameter_name_both:=0
let $include_complete_result_error_code_both:=0
let $include_complete_result_error_severity_both:=0
let $request_pdu:=0
let $request_parameter_value:=0
let $request_parameter_type:=0
let $request_parameter_name:=1
let $request_error_code:=0
let $request_error_severity:=0
let $response_pdu:=0
let $response_parameter_value:=0
let $response_parameter_type:=0
let $response_parameter_name:=0
let $response_error_code:=0
let $response_error_severity:=0
let $both_pdu:=0
let $both_parameter_value:=0
let $both_parameter_type:=0
let $both_parameter_name:=0
let $both_error_code:=0
let $both_error_severity:=0
let $comprimitive_name:="readDataByLocalID"
let $comprimitive_id:=""
let $pdu_byte_pattern_request:="8"
let $parameter_name_request:="$diagnosticMode^"
let $parameter_type_request:=""
let $parameter_value_request:=""
let $error_code_request:=""
let $error_severity_request:="w"
let $pdu_byte_pattern_response:=""
let $parameter_name_response:=""
let $parameter_type_response:="3"
let $parameter_value_response:=""
let $error_code_response:=""
let $error_severity_response:="w"
let $pdu_byte_pattern_both:=""
let $parameter_name_both:=""
let $parameter_type_both:="3"
let $parameter_value_both:=""
let $error_code_both:=""
let $error_severity_both:="w"
for $x in doc ($doc_name)/ProcessValueTrace/Trace
return
<ProcessValueTrace> <Trace>
{for $y in
$x/(StartTrace|OpenComPrimitive|DtsResult|CloseComPrimitive|StopTrace)
return
typeswitch($y)
case element(StartTrace)
return
if( $after_startstoptrace=1 and $exclude_items=0) then
sintax problem here
return $y
else ()
case element(OpenComPrimitive)
return
if(
($exclude_items=0 and
($after_comprimitive_logicallink_name=1 or $after_comprimitive_name=1
or
$after_comprimitive_id=1) and
(
( $after_comprimitive_logicallink_name=0 or
($ after_comprimitive_logicallink_name=1 and
(
some $z in $y/LogicalLink satisfies
(
contains($z/ShortName, string($logical_link_name))
)
)
)
)
and
( $after_comprimitive_name=0 or
($ after_comprimitive_name=1 and
(
contains($y/ShortName, string($comprimitive_name))
)
)
)
and
( $after_comprimitive_id=0 or
($ after_comprimitive_id=1 and
(
contains($y/ID, string($comprimitive_id))
)
)
)
)
)
) then
sintax problem here
return $y
else ()
case element(DtsResult)
return
{
if
(
(
start include complete conditions in DtsResult
(
($include_complete_result_pdu_request=1 and
( ($request_pdu=1)
and
(
some $xx in $y/DtsRequest satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_request))
)
)
)
)
or
($include_complete_result_parameter_name_request=1 and
( ($request_pdu=1)
and
(
some $xx in $y/DtsRequest/DtsRequestParameter satisfies
(
matches($xx/ShortName, string($parameter_name_request))
)
)
)
)
or
($include_complete_result_parameter_value_request=1 and
( ($request_parameter_value=1)
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue satisfies
(
contains($xx/Value, string($parameter_value_request))
)
)
)
)
or
($include_complete_result_parameter_type_request=1 and
( ($request_parameter_type=1)
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue satisfies
(
contains($xx/Type, string($parameter_type_request))
)
)
)
)
or
($include_complete_result_error_code_request=1 and
( ($request_error_code=1)
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsError satisfies
(
contains($xx/CodeDescription, string($error_code_request))
)
)
)
)
or
($include_complete_result_error_severity_request=1 and
( ($request_error_severity=1)
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsError satisfies
(
contains($xx/Severity, string($error_severity_request))
)
)
)
)
or
($include_complete_result_pdu_response=1 and
( ($response_pdu=1)
and
(
some $xx in $y/DtsResponse satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_response))
)
)
)
)
or
($include_complete_result_parameter_name_response=1 and
( ($response_pdu=1)
and
(
some $xx in $y/DtsResponse/DtsReponseParameter satisfies
(
contains($xx/ShortName, string($parameter_name_response))
)
)
)
)
or
($include_complete_result_parameter_value_response=1 and
( ($response_parameter_value=1)
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_response))
)
)
)
)
or
($include_complete_result_parameter_type_response=1 and
( ($response_parameter_type=1)
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_response))
)
)
)
)
or
($include_complete_result_error_code_response=1 and
( ($response_error_code=1)
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_response))
)
)
)
)
or
($include_complete_result_error_severity_response=1 and
( ($response_error_severity=1)
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_response))
)
)
)
)
or
($include_complete_result_pdu_both=1 and
( ($both_pdu=1)
and
(
(some $xx in $y/DtsRequest satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_both))
))
and
(some $xx in $y/DtsResponse satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_both))
))
)
)
)
or
($include_complete_result_parameter_name_both=1 and
( ($both_pdu=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter satisfies
(
contains($xx/ShortName, string($parameter_name_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter satisfies
(
contains($xx/ShortName, string($parameter_name_both))
))
)
)
)
or
($include_complete_result_parameter_value_both=1 and
( ($both_parameter_value=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_both))
))
)
)
)
or
($include_complete_result_parameter_type_both=1 and
( ($both_parameter_type=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_both))
))
)
)
)
or
($include_complete_result_error_code_both=1 and
( ($both_error_code=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_both))
))
)
)
)
or
($include_complete_result_error_severity_both=1 and
( ($both_error_severity=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_both))
))
)
)
)
)
end include complete conditions in DtsResult
or
(
start all non complete conditions in DtsResult
we must have some conditions
($request_pdu=1 or $request_parameter_name=1 or
$request_parameter_type=1 or
$request_parameter_value=1 or $request_error_code=1 or
$request_error_severity=1
or
$response_pdu=1 or $response_parameter_name=1 or
$response_parameter_type=1 or
$response_parameter_value=1 or $response_error_code=1 or
$response_error_severity=1
or
$both_pdu=1 or $both_parameter_name=1 or $both_parameter_type=1 or
$both_parameter_value=1 or $both_error_code=1 or
$both_error_severity=1)
and
($include_complete_result_pdu_request=1 or
($include_complete_result_pdu_request=0 and
(
($request_pdu=0 or
($request_pdu=1
and
(
some $xx in $y/DtsRequest satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_request))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_name_request=1 or
($include_complete_result_parameter_name_request=0 and
(
($request_parameter_name=0 or
($request_parameter_name=1
and
(
some $xx in $y/DtsRequest/DtsRequestParameter satisfies
(
contains($xx/ShortName, string($parameter_name_request))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_value_request=1 or
($include_complete_result_parameter_value_request=0 and
(
($request_parameter_value=0 or
($request_parameter_value=1
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_request))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_type_request=1 or
($include_complete_result_parameter_type_request=0 and
(
($request_parameter_type=0 or
($request_parameter_type=1
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_request))
)
)
)
)
)
)
)
and
($include_complete_result_error_code_request=1 or
($include_complete_result_error_code_request=0 and
(
($request_error_code=0 or
($request_error_code=1
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_request))
)
)
)
)
)
)
)
and
($include_complete_result_error_severity_request=1 or
($include_complete_result_error_severity_request=0 and
(
($request_error_severity=0 or
($request_error_severity=1
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_request))
)
)
)
)
)
)
)
and
($include_complete_result_pdu_response=1 or
($include_complete_result_pdu_response=0 and
(
($response_pdu=0 or
($response_pdu=1
and
(
some $xx in $y/DtsResponse satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_response))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_name_response=1 or
($include_complete_result_parameter_name_response=0 and
(
($response_parameter_name=0 or
($response_parameter_name=1
and
(
some $xx in $y/DtsResponse/DtsResponseParameter satisfies
(
contains($xx/ShortName, string($parameter_name_response))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_value_response=1 or
($include_complete_result_parameter_value_response=0 and
(
($response_parameter_value=0 or
($response_parameter_value=1
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_response))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_type_response=1 or
($include_complete_result_parameter_type_response=0 and
(
($response_parameter_type=0 or
($response_parameter_type=1
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_response))
)
)
)
)
)
)
)
and
($include_complete_result_error_code_response=1 or
($include_complete_result_error_code_response=0 and
(
($response_error_code=0 or
($response_error_code=1
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_response))
)
)
)
)
)
)
)
and
($include_complete_result_error_severity_response=1 or
($include_complete_result_error_severity_response=0 and
(
($response_error_severity=0 or
($response_error_severity=1
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_response))
)
)
)
)
)
)
)
and
($include_complete_result_pdu_both=1 or
($include_complete_result_pdu_both=0 and
(
($response_pdu=0 or
($response_pdu=1
and
(
(some $xx in $y/DtsResponse satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_both))
))
and
(some $xx in $y/DtsRequest satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_both))
))
)
)
)
)
)
)
and
($include_complete_result_parameter_name_both=1 or
($include_complete_result_parameter_name_both=0 and
(
($response_parameter_name=0 or
($response_parameter_name=1
and
(
(some $xx in $y/DtsResponse/DtsResponseParameter satisfies
(
contains($xx/ShortName, string($parameter_name_both))
))
and
(some $xx in $y/DtsRequest/DtsRequestParameter satisfies
(
contains($xx/ShortName, string($parameter_name_both))
))
)
)
)
)
)
)
and
($include_complete_result_parameter_value_both=1 or
($include_complete_result_parameter_value_both=0 and
(
($response_parameter_value=0 or
($response_parameter_value=1
and
(
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_both))
))
and
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_both))
))
)
)
)
)
)
)
and
($include_complete_result_parameter_type_both=1 or
($include_complete_result_parameter_type_both=0 and
(
($response_parameter_type=0 or
($response_parameter_type=1
and
(
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_both))
))
and
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_both))
))
)
)
)
)
)
)
and
($include_complete_result_error_code_both=1 or
($include_complete_result_error_code_both=0 and
(
($response_error_code=0 or
($response_error_code=1
and
(
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_both))
))
and
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_both))
))
)
)
)
)
)
)
and
($include_complete_result_error_severity_both=1 or
($include_complete_result_error_severity_both=0 and
(
($response_error_severity=0 or
($response_error_severity=1
and
(
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_both))
))
and
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_both))
))
)
)
)
)
)
)
)
end all non complete conditions in DtsResult
)) then
return
<DtsResult>
{for $xx in $y/LogicalLink
return $xx
}
{for $xx in $y/ComPrimitive
return $xx
}
{for $xx in $y/Type
return $xx
}
{for $xx in $y/State
return $xx
}
{for $xx in $y/StateInfo
return $xx
}
{for $vv in $y/DtsRequest
where
(
start complete conditions in DtsRequest
($include_complete_result_pdu_request=1 and
( ($request_pdu=1)
and
(
some $xx in $y/DtsRequest satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_request))
)
)
)
)
or
($include_complete_result_parameter_name_request=1 and
( ($request_pdu=1)
and
(
some $xx in $y/DtsRequest/DtsRequestParameter satisfies
(
contains($xx/ShortName, string($parameter_name_request))
)
)
)
)
or
($include_complete_result_parameter_value_request=1 and
( ($request_parameter_value=1)
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue satisfies
(
contains($xx/Value, string($parameter_value_request))
)
)
)
)
or
($include_complete_result_parameter_type_request=1 and
( ($request_parameter_type=1)
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue satisfies
(
contains($xx/Type, string($parameter_type_request))
)
)
)
)
or
($include_complete_result_error_code_request=1 and
( ($request_error_code=1)
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsError satisfies
(
contains($xx/CodeDescription, string($error_code_request))
)
)
)
)
or
($include_complete_result_error_severity_request=1 and
( ($request_error_severity=1)
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsError satisfies
(
contains($xx/Severity, string($error_severity_request))
)
)
)
)
or
($include_complete_result_pdu_response=1 and
( ($response_pdu=1)
and
(
some $xx in $y/DtsResponse satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_response))
)
)
)
)
or
($include_complete_result_parameter_name_response=1 and
( ($response_pdu=1)
and
(
some $xx in $y/DtsResponse/DtsReponseParameter satisfies
(
contains($xx/ShortName, string($parameter_name_response))
)
)
)
)
or
($include_complete_result_parameter_value_response=1 and
( ($response_parameter_value=1)
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_response))
)
)
)
)
or
($include_complete_result_parameter_type_response=1 and
( ($response_parameter_type=1)
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_response))
)
)
)
)
or
($include_complete_result_error_code_response=1 and
( ($response_error_code=1)
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_response))
)
)
)
)
or
($include_complete_result_error_severity_response=1 and
( ($response_error_severity=1)
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_response))
)
)
)
)
or
($include_complete_result_pdu_both=1 and
( ($both_pdu=1)
and
(
(some $xx in $y/DtsRequest satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_both))
))
and
(some $xx in $y/DtsResponse satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_both))
))
)
)
)
or
($include_complete_result_parameter_name_both=1 and
( ($both_pdu=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter satisfies
(
contains($xx/ShortName, string($parameter_name_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter satisfies
(
contains($xx/ShortName, string($parameter_name_both))
))
)
)
)
or
($include_complete_result_parameter_value_both=1 and
( ($both_parameter_value=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_both))
))
)
)
)
or
($include_complete_result_parameter_type_both=1 and
( ($both_parameter_type=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_both))
))
)
)
)
or
($include_complete_result_error_code_both=1 and
( ($both_error_code=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_both))
))
)
)
)
or
($include_complete_result_error_severity_both=1 and
( ($both_error_severity=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_both))
))
)
)
)
)
end complete conditions in DtsRequest
or
(
start all non complete conditions in DtsRequest
($request_pdu=1 or $request_parameter_name=1 or
$request_parameter_type=1 or
$request_parameter_value=1 or $request_error_code=1 or
$request_error_severity=1
or
$both_pdu=1 or $both_parameter_name=1 or $both_parameter_type=1 or
$both_parameter_value=1 or $both_error_code=1 or
$both_error_severity=1
)
and
($include_complete_result_pdu_request=1 or
($include_complete_result_pdu_request=0 and
(
($request_pdu=0 or
($request_pdu=1
and
(
contains($vv/PDU, string($pdu_byte_pattern_request))
)
)
)
)
)
)
and
($include_complete_result_parameter_name_request=1 or
($include_complete_result_parameter_name_request=0 and
(
($request_parameter_name=0 or
($request_parameter_name=1
and
(
some $xx in $vv/DtsRequestParameter satisfies
(
contains($xx/ShortName, string($parameter_name_request))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_value_request=1 or
($include_complete_result_parameter_value_request=0 and
(
($request_parameter_value=0 or
($request_parameter_value=1
and
(
some $xx in $y/DtsRequestParameter/DtsValue satisfies
(
contains($xx/Value, string($parameter_value_request))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_type_request=1 or
($include_complete_result_parameter_type_request=0 and
(
($request_parameter_type=0 or
($request_parameter_type=1
and
(
some $xx in $vv/DtsRequestParameter/DtsValue satisfies
(
contains($xx/Type, string($parameter_type_request))
)
)
)
)
)
)
)
and
($include_complete_result_error_code_request=1 or
($include_complete_result_error_code_request=0 and
(
($request_error_code=0 or
($request_error_code=1
and
(
some $xx in $vv/DtsRequestParameter/DtsError satisfies
(
contains($xx/CodeDescription, string($error_code_request))
)
)
)
)
)
)
)
and
($include_complete_result_error_severity_request=1 or
($include_complete_result_error_severity_request=0 and
(
($request_error_severity=0 or
($request_error_severity=1
and
(
some $xx in $vv/DtsRequestParameter/DtsError satisfies
(
contains($xx/Severity, string($error_severity_request))
)
)
)
)
)
)
)
and
($include_complete_result_pdu_both=1 or
($include_complete_result_pdu_both=0 and
(
($request_pdu=0 or
($request_pdu=1
and
(
contains($vv/PDU, string($pdu_byte_pattern_both))
)
)
)
)
)
)
and
($include_complete_result_parameter_name_both=1 or
($include_complete_result_parameter_name_both=0 and
(
($request_parameter_name=0 or
($request_parameter_name=1
and
(
some $xx in $vv/DtsRequestParameter satisfies
(
contains($xx/ShortName, string($parameter_name_both))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_value_both=1 or
($include_complete_result_parameter_value_both=0 and
(
($request_parameter_value=0 or
($request_parameter_value=1
and
(
some $xx in $y/DtsRequestParameter/DtsValue satisfies
(
contains($xx/Value, string($parameter_value_both))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_type_both=1 or
($include_complete_result_parameter_type_both=0 and
(
($request_parameter_type=0 or
($request_parameter_type=1
and
(
some $xx in $vv/DtsRequestParameter/DtsValue satisfies
(
contains($xx/Type, string($parameter_type_both))
)
)
)
)
)
)
)
and
($include_complete_result_error_code_both=1 or
($include_complete_result_error_code_both=0 and
(
($request_error_code=0 or
($request_error_code=1
and
(
some $xx in $vv/DtsRequestParameter/DtsError satisfies
(
contains($xx/CodeDescription, string($error_code_both))
)
)
)
)
)
)
)
and
($include_complete_result_error_severity_both=1 or
($include_complete_result_error_severity_both=0 and
(
($request_error_severity=0 or
($request_error_severity=1
and
(
some $xx in $vv/DtsRequestParameter/DtsError satisfies
(
contains($xx/Severity, string($error_severity_both))
)
)
)
)
)
)
)
)
end all non complete conditions in DtsRequest
return $vv
}
{for $vv in $y/DtsResponse
where
(
start complete conditions in DtsResponse
($include_complete_result_pdu_request=1 and
( ($request_pdu=1
and
(
some $xx in $y/DtsRequest satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_request))
)
)
)
)
)
or
($include_complete_result_parameter_name_request=1 and
( ($request_pdu=1
and
(
some $xx in $y/DtsRequest/DtsRequestParameter satisfies
(
contains($xx/ShortName, string($parameter_name_request))
)
)
)
)
)
or
($include_complete_result_parameter_value_request=1 and
( ($request_parameter_value=1
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue satisfies
(
contains($xx/Value, string($parameter_value_request))
)
)
)
)
)
or
($include_complete_result_parameter_type_request=1 and
( ($request_parameter_type=1
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue satisfies
(
contains($xx/Type, string($parameter_type_request))
)
)
)
)
)
or
($include_complete_result_error_code_request=1 and
( ($request_error_code=1
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsError satisfies
(
contains($xx/CodeDescription, string($error_code_request))
)
)
)
)
)
or
($include_complete_result_error_severity_request=1 and
( ($request_error_severity=1
and
(
some $xx in $y/DtsRequest/DtsRequestParameter/DtsError satisfies
(
contains($xx/Severity, string($error_severity_request))
)
)
)
)
)
or
($include_complete_result_pdu_response=1 and
( ($response_pdu=1
and
(
some $xx in $y/DtsResponse satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_response))
)
)
)
)
)
or
($include_complete_result_parameter_name_response=1 and
( ($response_pdu=1
and
(
some $xx in $y/DtsResponse/DtsReponseParameter satisfies
(
contains($xx/ShortName, string($parameter_name_response))
)
)
)
)
)
or
($include_complete_result_parameter_value_response=1 and
( ($response_parameter_value=1
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_response))
)
)
)
)
)
or
($include_complete_result_parameter_type_response=1 and
( ($response_parameter_type=1
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_response))
)
)
)
)
)
or
($include_complete_result_error_code_response=1 and
( ($response_error_code=1
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_response))
)
)
)
)
)
or
($include_complete_result_error_severity_response=1 and
( ($response_error_severity=1
and
(
some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_response))
)
)
)
)
)
or
($include_complete_result_pdu_both=1 and
( ($both_pdu=1)
and
(
(some $xx in $y/DtsRequest satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_both))
))
and
(some $xx in $y/DtsResponse satisfies
(
contains($xx/PDU, string($pdu_byte_pattern_both))
))
)
)
)
or
($include_complete_result_parameter_name_both=1 and
( ($both_pdu=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter satisfies
(
contains($xx/ShortName, string($parameter_name_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter satisfies
(
contains($xx/ShortName, string($parameter_name_both))
))
)
)
)
or
($include_complete_result_parameter_value_both=1 and
( ($both_parameter_value=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Value, string($parameter_value_both))
))
)
)
)
or
($include_complete_result_parameter_type_both=1 and
( ($both_parameter_type=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsValue
satisfies
(
contains($xx/Type, string($parameter_type_both))
))
)
)
)
or
($include_complete_result_error_code_both=1 and
( ($both_error_code=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/CodeDescription, string($error_code_both))
))
)
)
)
or
($include_complete_result_error_severity_both=1 and
( ($both_error_severity=1)
and
(
(some $xx in $y/DtsRequest/DtsRequestParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_both))
))
and
(some $xx in $y/DtsResponse/DtsResponseParameter/DtsError
satisfies
(
contains($xx/Severity, string($error_severity_both))
))
)
)
)
)
end complete conditions in DtsResponse
or
(
start all non complete conditions in DtsResult
(
$response_pdu=1 or $response_parameter_name=1 or
$response_parameter_type=1 or
$response_parameter_value=1 or $response_error_code=1 or
$response_error_severity=1
or
$both_pdu=1 or $both_parameter_name=1 or $both_parameter_type=1 or
$both_parameter_value=1 or $both_error_code=1 or
$both_error_severity=1)
and
($include_complete_result_pdu_response=1 or
($include_complete_result_pdu_response=0 and
(
($response_pdu=0 or
($response_pdu=1
and
(
contains($vv/PDU, string($pdu_byte_pattern_response))
)
)
)
)
)
)
and
($include_complete_result_parameter_name_response=1 or
($include_complete_result_parameter_name_response=0 and
(
($response_parameter_name=0 or
($response_parameter_name=1
and
(
some $xx in $vv/DtsResponseParameter satisfies
(
contains($xx/ShortName, string($parameter_name_response))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_value_response=1 or
($include_complete_result_parameter_value_response=0 and
(
($response_parameter_value=0 or
($response_parameter_value=1
and
(
some $xx in $y/DtsResponseParameter/DtsValue satisfies
(
contains($xx/Value, string($parameter_value_response))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_type_response=1 or
($include_complete_result_parameter_type_response=0 and
(
($response_parameter_type=0 or
($response_parameter_type=1
and
(
some $xx in $vv/DtsResponseParameter/DtsValue satisfies
(
contains($xx/Type, string($parameter_type_response))
)
)
)
)
)
)
)
and
($include_complete_result_error_code_response=1 or
($include_complete_result_error_code_response=0 and
(
($response_error_code=0 or
($response_error_code=1
and
(
some $xx in $vv/DtsResponseParameter/DtsError satisfies
(
contains($xx/CodeDescription, string($error_code_response))
)
)
)
)
)
)
)
and
($include_complete_result_error_severity_response=1 or
($include_complete_result_error_severity_response=0 and
(
($response_error_severity=0 or
($response_error_severity=1
and
(
some $xx in $vv/DtsResponseParameter/DtsError satisfies
(
contains($xx/Severity, string($error_severity_response))
)
)
)
)
)
)
)
and
($include_complete_result_pdu_both=1 or
($include_complete_result_pdu_both=0 and
(
($response_pdu=0 or
($response_pdu=1
and
(
contains($vv/PDU, string($pdu_byte_pattern_both))
)
)
)
)
)
)
and
($include_complete_result_parameter_name_both=1 or
($include_complete_result_parameter_name_both=0 and
(
($response_parameter_name=0 or
($response_parameter_name=1
and
(
some $xx in $vv/DtsResponseParameter satisfies
(
contains($xx/ShortName, string($parameter_name_both))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_value_both=1 or
($include_complete_result_parameter_value_both=0 and
(
($response_parameter_value=0 or
($response_parameter_value=1
and
(
some $xx in $y/DtsResponseParameter/DtsValue satisfies
(
contains($xx/Value, string($parameter_value_both))
)
)
)
)
)
)
)
and
($include_complete_result_parameter_type_both=1 or
($include_complete_result_parameter_type_both=0 and
(
($response_parameter_type=0 or
($response_parameter_type=1
and
(
some $xx in $vv/DtsResponseParameter/DtsValue satisfies
(
contains($xx/Type, string($parameter_type_both))
)
)
)
)
)
)
)
and
($include_complete_result_error_code_both=1 or
($include_complete_result_error_code_both=0 and
(
($response_error_code=0 or
($response_error_code=1
and
(
some $xx in $vv/DtsResponseParameter/DtsError satisfies
(
contains($xx/CodeDescription, string($error_code_both))
)
)
)
)
)
)
)
and
($include_complete_result_error_severity_both=1 or
($include_complete_result_error_severity_both=0 and
(
($response_error_severity=0 or
($response_error_severity=1
and
(
some $xx in $vv/DtsResponseParameter/DtsError satisfies
(
contains($xx/Severity, string($error_severity_both))
)
)
)
)
)
)
)
)
end all non complete conditions in DtsResponse
return $vv
}
</DtsResult>
else ()
}
case element (CloseComPrimitive)
return
{
if(
($exclude_items=0 and
($after_comprimitive_logicallink_name=1 or $after_comprimitive_name=1
or
$after_comprimitive_id=1) and
(
( $after_comprimitive_logicallink_name=0 or
($ after_comprimitive_logicallink_name=1 and
(
some $z in $y/LogicalLink satisfies
(
contains($z/ShortName, string($logical_link_name))
)
)
)
)
and
( $after_comprimitive_name=0 or
( $after_comprimitive_name=1 and
(
contains($y/ShortName, string($comprimitive_name))
)
)
)
and
($ after_comprimitive_id=0 or
($ after_comprimitive_id=1 and
(
contains($y/ID, string($comprimitive_id))
)
)
)
)
)) then
return $y
else ()
}
case element(StopTrace)
{
if( $after_startstoptrace=1 and $exclude_items=0) then
return $y
else ()
}
default return $y
}
</Trace> </ProcessValueTrace>