Northwoods.Go.Xml Assembly > Northwoods.Go.Xml Namespace > GoXmlBindingTransformer Class : HandlesChildren Property |
If you are defining a transformer for a Northwoods.Go.GoSubGraphBase-inheriting class, you'll want to set this to true.
Setting this to true also automatically sets BodyConsumesChildElements to true.
You may find that nested elements are being generated for child objects for which you do not want separate XML elements. This may happen, for example, when you define a transformer for the Northwoods.Go.GoText class and for a node class that has a predefined label as well as a variable number of additional Northwoods.Go.GoText children. You have at least two choices.
One choice is to replace all of those non-label Northwoods.Go.GoText child objects with instances of some class that inherits from Northwoods.Go.GoText. Because transformers are defined per type, this is an easy way to discriminate between the usages of text objects. Your transformer should then be defined for your custom class inheriting from Northwoods.Go.GoText, instead of for Northwoods.Go.GoText itself.
The other choice is to make the transformer for Northwoods.Go.GoText smarter. Use a transformer inheriting from GoXmlBindingTransformer and override the GoXmlTransformer.SkipGeneration method to return true when the text object is actually a label handled as a node attribute, and to return false when the text object is supposed to be represented as a separate nested XML element.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2