1 Reply Latest reply on Nov 9, 2006 5:11 AM by Ronald van Kuijk

    whitespace stripping and newline removal from scripts (or an

    Bruno Dumon Newbie

      Hi,

      I've noticed that jBPM trims whitespace and removes newlines from scripts (or any action/delegation XML config).

      With scripts, this can be a bit annoying for multiple reasons:
      - since there are no separate lines anymore, it makes error reporting by the script engine less readable
      - the meaning of things might be changed, e.g. a string like " abc def" will become " abc def".
      - single-line comments using "//" are not possible.

      I've tracked the cause of this down to the creation of the class Delegation, where an XMLWriter is instantiated using "createCompactFormat" to create the serialized configuration:

      XMLWriter xmlWriter = new XMLWriter( stringWriter, OutputFormat.createCompactFormat() );

      I don't know if removal of the compact format usage would cause any issues (e.g. other places relying on the whitespace being removed) besides a little bit more whitespace stored in the database, but otherwise I would very much appreciate if it could be removed. Or maybe some attribute could be added to the action element to indicate the whitespace-treatment preference.