Idea

Serge A avatar image
6 Likes"
Serge A suggested Serge A edited

Support CDATA in FlexSim FSX

FlexSim command cmdsavetree(somenode, "path.fsx") saves a tree in XML format. All code is saved as text data on some of the tree nodes. FlexSim uses predefined character entities like <, >, & to escape characters '<', '>', '&' which are very common in Flexscript code. FlexSim doesn't support other human-readable formats to save code.

The code sections written to XML and escaped this way are much less readable than code written verbatim. Also, it is inconvenient to edit XML files by hand or simply searching for some expressions in such files.

An alternative solution is to use XML CDATA sections for longer text and code nodes. In this case only "]]>" sequence has to be escaped, and special characters can be used verbatim.

https://i.imgur.com/HiAYTB6.png

Above: FSX with CDATA, code is easily readable and can be edited by hand.
Below: FSX as saved by FlexSim.

Currently (FlexSim 2017 LTS and FlexSim 2018 Beta):

  • FlexSim doesn't use CDATA when saving files
  • FlexSim cannot load valid XML if it contains CDATA sections (cmdsavetree silently fails and only some nodes are loaded)

The proposal is:

  • Update XML reader to allow CDATA in XML, as it is valid XML 1.0 (Sec 2.7 of the spec) and should not lead to data loss
  • Consider using CDATA sections when saving code nodes
flexscriptfsxfile formats
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

No Comments

·

Write a Comment

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.