3.7 User tag options

When using the plugin's serialization interface it's possible to pass a few options to the serializer through Hollywood user tags. The following user tag options are currently supported:

RootNode
This can be used to set the name of the XML's root node. This is only used if the serialization mode is #SERIALIZEMODE_HOLLYWOOD. It defaults to "root".

IgnoreWhiteSpace
When using the list or named serialization modes, the XML plugin will set the Text field of nodes that contain nothing but whitespace characters (e.g. space, tab, line breaks...) to an empty string. If you don't want that, set this item to False. The default value is True. This tag is ignored for the Hollywood serialization mode.

Here's how to pass user tags to the serializer:

 
SetSerializeMode(#SERIALIZEMODE_HOLLYWOOD)
s$=SerializeTable(t, {Adapter = "xml", UserTags = {RootNode = "base"}})

This code will change the root node's name to <base> instead of <root> when using the Hollywood serialization mode.


Show TOC