locked
expression syntax RRS feed

  • Question

  • Hi,

     

    I'm having some trouble with this syntax:

     

    @[User::xml_output] != "<ROOT></ROOT>"

     

     

    I have a variable that I KNOW is = '<ROOT></ROOT>'  and I've set up a precendence constraint to only go to the next step if the above not true, correct?

     

    Do I need to convert the right side of the equation to a string or something first? Does anybody know that syntax off hand?

     

     

    Thanks,

    Phil

    Thursday, April 26, 2007 7:29 PM

Answers

  • Looks good to me.  CAsE will matter and so will any spaces, of course.


    Make sure you don't have another variable of the same name with a different scope.

    And how do you KNOW the variable is populated with what you think it is?  Have you debugged with a breakpoint set using the on PostExecute() event of the task before the "next step" and then looked at the locals window?
    Thursday, April 26, 2007 7:36 PM

All replies

  • I don't know what the problem is but maybe try this:

     

    @[User::xml_output] != (DT_STR, <length>, 1252)"<ROOT></ROOT>"

     

    I'd be surprised if this worked tho!

     

    -jamie

     

    Thursday, April 26, 2007 7:34 PM
  • Looks good to me.  CAsE will matter and so will any spaces, of course.


    Make sure you don't have another variable of the same name with a different scope.

    And how do you KNOW the variable is populated with what you think it is?  Have you debugged with a breakpoint set using the on PostExecute() event of the task before the "next step" and then looked at the locals window?
    Thursday, April 26, 2007 7:36 PM
  • Jamie,

     

    Is there a way to remove trailing leading spaces from a variable in expression syntax? I think that may be the issue.

     

     

    Thanks,

    Phil

    Thursday, April 26, 2007 7:39 PM
  •  tackett wrote:

    Jamie,

    Is there a way to remove trailing leading spaces from a variable in expression syntax? I think that may be the issue.

    Thanks,

    Phil



    trim(@[User::Variable]) != "string"

    This will do leading and trailing
    Thursday, April 26, 2007 7:42 PM
  • Good stuff guys. That really helped. Turns out there were a few extra characters in there. Thanks Phil and Jamie.

     

     

     

     

     

    Thursday, April 26, 2007 7:49 PM