Initializing help system before first use

# sethspace

Purpose
Set horizontal spacing of a node.
Synopsis
`procedure sethspace(doc:xmldoc, n:integer, s:integer)`
Arguments

doc | Document to use
n | Node number
s | Number of spaces to put before the node output

Example
The following example reformats the XML document layout by adding an additional line before 'region' nodes and printing three consecutive tags within 'employee' on a single line. The indentmode is set to 'manual' in order to apply the user formatting (instead of automatic or none).

      declarations
        DB: xmldoc
        NodeList, Employees: list of integer
      end-declarations

    ! New line without indentation for Root
      setvspace(DB, Root, 1)

    ! Add extra line in between regions, keeping original indentation
      getnodes(DB, "personnelList/region", NodeList)
      forall(r in NodeList) setvspace(DB, r, 2)

    ! Spacing/indentation for 'employee' tag
      getnodes(DB, "personnelList/region/employee", Employees)
      forall(p in Employees) do
        setvspace(DB, p, 1); sethspace(DB, p, 4)

      ! Within 'employee', display up to 3 consecutive tags on a single line
        getnodes(DB, p, "child::node()[position() mod 3=1]", NodeList)
        forall(r in NodeList) do
          setvspace(DB, r, 1); sethspace(DB, r, 6)
        end-do
        getnodes(DB, p, "child::node()[position() mod 3<>1]", NodeList)
        forall(r in NodeList) do
          setvspace(DB, r, 0); sethspace(DB, r, 1)
        end-do
      end-do

    ! Set indentation mode to 'manual' to use our own formatting for display
      setindentmode(DB, XML_MANUAL)
      save(DB, "")

Further information
This spacing indicates the number of spaces to skip from the start of a new line before displaying the node when outputing the document. The horizontal spacing setting is only used when the indentation is in manual mode (see setindentmode).
Related topics
setvspace, setindentmode
Module
mmxml
Parent Topic mmxml

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.