XLT If Statement

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf XLT If Statement

  • Creator
    Topic
  • #51030
    Susan Ferraz
    Participant

      I translate XML to HL7.

      In my XLT I have IF statements that test whether a variable equals to a field name in the XML.

      @Field eq=.

      One of the fields in the XML has a space before the field name, see XML example below. Therefore, Cloverleaf doesn’t recognize this field.

      APT 1

      If I add a space before the field name in the IF statement I get a syntax error.

      Is there a way to put a space between the equal sign and the string, so cloverleaf recognizes the string name? I tried adding quotes but had no luck.

      @fld_name eq =hc_address2

      Thanks, Susan

    Viewing 1 reply thread
    • Author
      Replies
      • #68503
        Jim Kosloskey
        Participant

          Susan,

          Try COPYng your field name to a temp variable

          COPY = —> @myfieldname

          The use the temp variable in the IF

          IF @Field eq @myfieldname

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #68504
          Susan Ferraz
          Participant

            Hi Jim,

            This works.

            Thanks, Susan

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