Schema - "complex" criteria

Wise forum folks,

One more question for you.  XFM Schema appears to have difficulty with interpreting "complex" criteria (e.g., criteria that reference more than one attribute), such as:

     ([attribute1]>0) && ([attribute2]<100)

Or even better:

     COMPARE("[attributea]","True","") && ([attributeb]>0)

I couldn't find guidance in the Help files addressing situations like this.  Has anyone else tried something similar?

Thanks.

Janice

Parents Reply Children
  • Thanks for pointing that out.  I actually have a number of instances where I *want* the expression to fail.  Take my example #2 -

        COMPARE("[attributea]","True","") && ([attributeb]>0)

    When this expression is true, I want to place a cell (Cell B) containing PBA Replacement Text that is populated by Attribute B.  When there is no Attribute B, this expression obviously fails, and Cell B is not placed.  In this case (Attribute B does not exist), I actually prefer to place another cell (Cell A), so I've written another expression to "catch" this:

        COMPARE("[attributea]","True","")

    As you point out, I just need to make sure that the first expression appears first in the .xml hierarchy so that it's evaluated first - otherwise, the second expression will take precedence (and Cell A will be placed for each instance, regardless of whether Attribute B exists or not.)

    Side note: I don't want to pass a default value in the expression (as you suggested) for various reasons.  For one thing, the default value would end up populating the PBA Replacement Text, and I don't want that...

    Just curious, can I write an expression that queries whether or not Attribute B *exists*?  What syntax would I use?

    Thanks,

    Janice

  • Clarification on the default value syntax.  The default value is only used in the expression when the property has no value just so that we produce a syntactically correct expression.  The default value is not set into the property in the feature instance.  So you would not later see this default value in the PBA replacement text.

    Regarding checking if a property exists, I'm thinking that you mean, does my property have a value? You could check if a property has a value by checking the property's value string length.  

    Check if the length of a feature's property value is not zero using the C string length function "strlen".

    0!=strlen("[feature_instance_alias:property_name]")


    This is a test