xquery help

Discussion in 'XML' started by paul.rusu@gmail.com, Nov 7, 2005.

  1. Guest

    :)// 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>
    :)
    , Nov 7, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Kish

    xquery help

    Jeff Kish, Oct 14, 2004, in forum: XML
    Replies:
    7
    Views:
    524
    Jeff Kish
    Oct 18, 2004
  2. Tony Lavinio
    Replies:
    0
    Views:
    403
    Tony Lavinio
    Apr 28, 2005
  3. xquery help please

    , Nov 8, 2005, in forum: XML
    Replies:
    1
    Views:
    451
    Priscilla Walmsley
    Nov 8, 2005
  4. Replies:
    0
    Views:
    344
  5. Replies:
    0
    Views:
    364
Loading...

Share This Page