sethspace
| sethspace | 
 procedure sethspace(doc:xmldoc, n:integer, s:integer) 
 | 
     doc 
     | 
     Document to use
     | 
| 
     n 
     | 
     Node number
     | 
| 
     s 
     | 
     Number of spaces to put before the node output
     | 
  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, "") 
© 2001-2019 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.
 
