Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Formats a XML string with color.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
XML | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
(old name: XML.Colourise)
Parameter | Description | Example | Flags |
---|---|---|---|
XML | The XML text to process. | "<test>Hello</test>" | |
DarkMode | Available in MBS FileMaker Plugin 12.1 or newer. Whether to swap colors to use white for text color. Pass 1 for dark mode and 0 for light mode. Default is 0 for light mode. |
0 | Optional |
Returns formatted text or error.
Colorize a field:
Set Field [ Data::XML ; MBS("XML.Colorize"; Data::XML) ]
Line numbers, color and format:
MBS( "Text.AddLineNumbers"; MBS( "XML.Colorize"; MBS( "XML.Format"; Buckets::Listing)))
Colorize in Auto-Enter calculation:
MBS("XML.Colorize"; self)
// put this calculation into a field, so the field gets colorized whenever the field is changed and the record gets commited.
Colorize and format in Auto-Enter calculation:
Let ( [
xmlFormatted = MBS("XML.Format"; Self);
xmlFormatFailed = MBS("IsError");
xmlText = If(xmlFormatFailed; Self; xmlFormatted);
result = MBS("XML.Colorize"; xmlText)
]; result )
// put this calculation into a field, so the field gets formated and colorized whenever the field is changed and the record gets commited.
This function is free to use.
Created 8th April 2018, last changed 7th December 2022