Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Dictionary.ToXML

Returns XML representation of dictionary for data exchange.

Component Version macOS Windows Linux Server iOS SDK
Dictionary XML 6.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Dictionary.ToXML"; DictionaryRef { ; Format; RootName } )   More

Parameters

Parameter Description Example Flags
DictionaryRef The reference number to the dictionary. $dic
Format If 1, we format pretty.
Pass 0 to get compact xml.
1 Optional
RootName Available in MBS FileMaker Plugin 13.2 or newer.
The root name for the XML.
Default is dictionary.
"dictionary" Optional

Result

Returns text or error.

Description

Returns XML representation of dictionary for data exchange.

Examples

Test exporting dictionaries:

#
#
#Create new Dictionary
#
Set Variable [$param; Value:MBS( "Dictionary.Create" )]
#
#Fill in values
#
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "text"; Pass Parameters with Dictionary::TextField )]
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "number"; Pass Parameters with Dictionary::NumberField)]
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "date"; Pass Parameters with Dictionary::DateField)]
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "time"; Pass Parameters with Dictionary::TimeField)]
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "timestamp"; Pass Parameters with Dictionary::TimeStampField)]
Set Variable [$r; Value:MBS( "Dictionary.SetValueForKey"; $param; "container"; Pass Parameters with Dictionary::ContainerField)]
#
#Call save xml, json and text
#
Set Variable [$r; Value:MBS( "Text.WriteTextFile"; MBS("Dictionary.ToXML"; $param; 1); MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ) ; "dictionary.xml"); "UTF8")]
Set Variable [$r; Value:MBS( "Text.WriteTextFile"; MBS("Dictionary.ToText"; $param); MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ) ; "dictionary.txt"); "UTF8")]
Set Variable [$r; Value:MBS( "Text.WriteTextFile"; MBS("Dictionary.ToJSON"; $param); MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ) ; "dictionary.json.txt"); "UTF8")]
#
#free memory
#
Set Variable [$r; Value:MBS("Dictionary.Release"; $param)]

See also

Release notes

Blog Entries

This function checks for a license.

Created 25th February 2016, last changed 11st April 2023


Dictionary.ToText - Dictionary.ValueForKey