TrxId proc for xml message

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf TrxId proc for xml message

  • Creator
    Topic
  • #50805
    Mason Miller
    Participant

      I am trying to write a TrxId proc but I am not sure how to pull the field that I want to use for the trxId it is an xml file and the I need to use the value in the tag below any suggestions?

      Initial Assignment

    Viewing 6 reply threads
    • Author
      Replies
      • #67584

        Try something like this …

        Code:

        set msg “Initial Assignment
        regexp — {(.*?)} $msg match trxId
        puts $trxId

        -- Max Drown (Infor)

      • #67585
        Mason Miller
        Participant

          Code:

          set msg [msgget $mh]

          set pattern {.*?}

          set trxId [regexp -all -inline — $pattern $msg]

          }
             return $trxId

          this is what I have and it will return value that I want but it also returns the tags how can I just pull out the value between the description tags?

        • #67586
          Charlie Bursell
          Participant

            The regexp inline you have coded will return the whole tag not just the value.

            If you really wanted to do it this way, it would be

            set pattern {(.*?)}

            set trxId [lindex [regexp -all -inline — $pattern $msg] 1]

            However, I prefer the way Max did.  One thing though Max, a forward slash (/) is not a meta character and need not be back-slashed  ðŸ˜€

            [/quote]

          • #67587

            Fixed!

            -- Max Drown (Infor)

          • #67588
            Mason Miller
            Participant

              I could not get it to work the way Max had it the trxid was returning blank but I did get it to work the other way.

              Thanks for all your help

            • #67589
              Michael Hertel
              Participant

                Max, after you fixed the backslash I ran your command.

                I love the sset comand. You learn something new every day!  ðŸ˜›

              • #67590

                sset is a typo. Sorry. I fixed it.

                -- Max Drown (Infor)

            Viewing 6 reply threads
            • The forum ‘Cloverleaf’ is closed to new topics and replies.