fmefunc Expressions

Thefmefuncexpression allows FME mapping file functions to be called. It is represented in the xfMap document with theelement, and it has the following general form:

       ...    

Theexpression string (i.e., theexprattribute) specifies an FME function. FME functions are named with an “at” sign, @, as their first character. Both type of FME functions, i.e., feature and attribute functions, may be specified.

If the string in theexprattribute does not start with an @ sign, then its literal value is returned, otherwise the FME function is evaluated for its return value, bare in mind that FME feature functions do not return a value so an empty string is returned if this is the case.

Thefmefuncexpression may have 0 or more optional arguments that are expression sequences. Each expression sequence in anelement should evaluate to an FME function specification, meaning that its first character must be the @, otherwise, the evaluated expression is simply concatenated as part of the final result for thefmefuncexpression.

The evaluated value for anfmefuncexpression is the concatenation of the results for all specified FME function specifications.

每一个fmefuncexpression works upon its own “scratch” FME feature allowing the possibility for algorithmic computations because the state of this temporary feature is not reset between the evaluation of the expression’s arguments and each argument is evaluated in order. Algorithmic calculations are achieved by “stacking up” a series of feature and or attribute FME functions.

Example

items.xml

   key0 he5390 312129.20N 0854453.20W  

items.xmp

                 <fmefunc expr = " " > <报告> @SupplyAttributes (geoLat LAT,geoLong,LON)              x,y     >     

FME features constructed:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Feature Type: `item' Attribute(string): `fme_geometry' has value `fme_point' Attribute(string): `geoLat' has value `312129.20N' Attribute(string): `geoLong' has value `0854453.20W' Attribute(string): `xml_type' has value `xml_point' Geometry Type: Point (1) Number of Coordinates: 1 -- Coordinate Dimension: 2 -- Coordinate System: `' (-85.7481083333333,31.3581111111111) =================================================================== ===================================================================