4D Blog

Home Product XML invisible characters on stage!

XML invisible characters on stage!

October 11, 2021

Product

Default End Of Line character and Byte Order Mark usage in text files have been modified in 4D v19 R2. With 4D v19 R3, 4D extends this behavior to XML files. Let’s see how.

This former blog-post was dedicated to modification on default End Of Line (EOL) character and Byte Order Mark (BOM) usage in text files.
Following the best practices described in it, 4D now extends the text files behavior to XML files written using DOM and SAX commands.

NEW BEHAVIORS

On macOS, XML files were written by default with CR as EOL when using DOM commands, and the two characters CRLF when using SAX commands. With the new behavior, XML files are written with LF as EOL, using DOM and SAX commands. This will standardize the behavior between DOM and SAX, and improve compatibility with version control systems like Git, which need to use LF as EOL character.
There are no changes on Windows for the EOL character since CRLF is correctly managed by version control systems like Git.

On all platforms, XML files are now written without BOM, using DOM and SAX commands. As UTF-8 has nearly become the standard text file format, the BOM is less and less used. So, 4D still follows the current best practices.

COMPATIBILITY SETTINGS

No changes will appear when moving an existing project or database to 4D v19 R3.

If your project or database was created with a former version than 4D v19 R2, the following compatibility settings will appear to activate the new behaviors:

⚠️   When opened in 4D v19 R3, projects or databases created with 4D v19 R2 behave differently regarding default EOL character and BOM management in XML documents only. Even though the new behavior is active and the compatibility options are available since 4D v19 R2 for text files, this new behavior is available only since 4D V19 R3 for XML files.

STAY IN CONTROL

If you want to define yourself which EOL character to use when writing an XML file using DOM or SAX commands, the XML SET OPTIONS command admits now the new selector XML line ending, which can get the following values: XML default, XML CR, XML LF or XML CRLF.

In the same way, you can define yourself if a BOM is inserted in the XML file using DOM or SAX commands by setting the new selector XML BOM in the XML SET OPTIONS command. This selector admits three values: XML default, XML enabled or XML disabled.

Of course, you can use these two new selectors with the XML GET OPTIONS command to know which behavior is currently in use.

⚠️   Since SAX file lines are written directly at each statement, if you need to set the BOM and/or EOL options, you must call the XML SET OPTIONS command before the first SAX writing command.

Discuss

Tags Compatibility settings, Source control, v19 R3, v20, XML

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

Avatar
Damien Fuzeau
• Product Owner •Damien Fuzeau has joined the 4D Product team in February 2019. As a Product Owner, he is in charge of writing user stories, then translating them to functional specifications. His job also entails making sure that the feature implementations delivered are meeting the customer needs.Damien is graduated from the University of Nantes in software engineering. He spent more than 23 years in its former company, first as developer (discovering 4D in 1997), and later as engineering manager and software architect. This company is a 4D OEM partner and deployed 4D based business softwares for thousands users, on hundreds servers. So, Damien is used to 4D development and deployment in a multi-language context.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula Listbox Logs Mail Microsoft 365 Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy