Removing Unwanted Spaces from XML Source Data

This feature is available in SPSS® Modeler Professional and SPSS Modeler Premium.

Line breaks in the XML source data may be implemented by a [CR][LF] character combination. In some cases these line breaks can occur in the middle of a text string, for example:

<description>An in-depth look at creating applications[CR][LF]
with XML.</description>

These line breaks may not be visible when the file is opened in some applications, for example a Web browser. However, when the data are read into the stream through the XML source node, the line breaks are converted to a series of space characters.

You can correct this by using a Filler node to remove these unwanted spaces:

Here is an example of how you can achieve this:

  1. Attach a Filler node to the XML source node.
  2. Open the Filler node and use the field chooser to select the field with the unwanted spaces.
  3. Set Replace to Based on condition and set Condition to true.
  4. In the Replace with field, enter replace(" ","",@FIELD) and click OK.
  5. Attach a Table node to the Filler node and run the stream.

In the Table node output, the text now appears without the additional spaces.