How to BIML expression with string literal?

I am trying to put an expression on my PrecedenceConstraint which is just @[$Package::Variable] == "Y". If it was a number, no issues, but the double quotes is a real spanner in the works. I tried using a variable:

 <PrecedenceConstraints >
<#var Test = "@[Package::variable] == \"N\""; #>
<Inputs>
<Input OutputPathName="Get Frozen Val Count.Output" EvaluationOperation="Expression" Expression="<#=Test#>"/>
</Inputs>
</PrecedenceConstraints>

The compiler says N is an unexpected token. What am I supposed to do here?

0

Comments

2 comments
  • Can you try and encode the quotation marks?

    & quot ;

    is the XML parsable encoding for a quotation mark. so your code would look something like:

     

    <Inputs>
        <Input OutputPathName="Get Frozen Val Count.Output" EvaluationOperation="Expression" Expression="@[Package::variable] == &quot;N&quot;" />
    </Inputs>
    0
    Comment actions Permalink
  • Great. Thanks, that worked. Ill add it to my list of things to try when stuck!
    0
    Comment actions Permalink

Please sign in to leave a comment.