Frequently asked question

Can I keep leading blanks in values returned in a FEATURES response?

Last Published: April 25, 2020


Starting with ArcIMS 9.0, a configuration setting is available for users who require that leading and trailing blanks be kept in values returned in a FEATURES response. A response may appear as follows:

<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
<ENVELOPE minx="-118.25" miny="34" maxx="-118.25" maxy="34"/>
<FIELDS AVALUE=" 99876 " #SHAPE#="[Geometry]" #ID#="534" />
<FEATURECOUNT count="1" hasmore="false" />
The field value for 'AVALUE' has leading and trailing spaces. Instructions for implementing this are given below. Before giving out instructions, be aware that ESRI has decided not to publicize this fix because it BREAKS THE HTML VIEWER. If someone selects to implement this, they must be informed that it breaks the HTML Viewer. Details are in CQ00188652.

In summary, the parsing of a FEATURES response in the HTML Viewer is handled by a JavaScript function that looks for values inside quotes. One of its shortcomings is if there is a blank immediately after a quote, the parsing stops for that particular item because it thinks it's at the end of the item to parse. Thus, any value with leading blanks gets discarded. The final table created with the data becomes formatted strangely and much of the data appears to be missing.

If someone wants to parse this correctly, the FEATURES response must use JavaScript string parsing that matches up beginning and ending quotes. This is probably best done by setting outputmode in GET_FEATURES to "newxml". The response is longer and will take more time to parse.
Information from CQ00186580 on how to set this up:

The trigger for this functionality is in the following spatial server cfg files.
--aimsfs.cfg (for feature services)
--aimsqs.cfg (for image services)

Step 1:
Open aimsqs.cfg, and go to the PARAMETERS section. Add the REMOVE_WHITE_SPACE parameter to the list. Note that REMOVE_WHITE_SPACE is case sensitive and must be all upper case.

<PARAMETER name="type" value="QueryServer" />
<PARAMETER name="REMOVE_WHITE_SPACE" value="false" />

Next, open aimsfs.cfg and do the same thing:

<PARAMETER name="type" value="FeatureServer" />
<PARAMETER name="REMOVE_WHITE_SPACE" value="false" />

Step 2:
Restart monitor and appserver.

Note 1: By default, the PARAMETER info for whitespace is not included in the cfg files. You have to add it.

Note 2: this is an "all or nothing" solution. All query or features servers for a machine will either trim or not trim whitespace around values. You cannot do this on a per service or layer basis.

Remember, this is not a public solution because IT BREAKS THE HTML VIEWER.

Identify and Select work fine with leading and trailing spaces with the following:

--Feature service in AEJ and ArcMap.
--Image service in AEJ and ArcMap.
--Image service in HTML viewer - problem with FEATURES parsing, see CQ00188652.

Article ID:000006135

  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic