XML to BDL serialization options

By default, Genero Web Services XML to BDL serialization will raise errors, if the XML content does not match the BDL variable receiving the data.

To relax the serialization, you can specify the options xml_ignoreunknownelements and xml_ignoreunknownattributes to the xml.Serializer class.

For example, if the BDL variable is defined as follows:
     val1 INTEGER ATTRIBUTES(XMLName= "Value1"),
     val2 STRING ATTRIBUTES(XMLName= "Value2")
     attr INTEGER ATTRIBUTES(XMLAttribute,XMLName= "MyAttr")
The following XML document will by default raise conversion errors because the "badAttr" attribute and the "Unexpected" node are not defined in the corresponding BDL variable:
<Demo MyAttr="hello" badAttr= "BAD">
  <Unexpected1>Will be ignored</Unexpected1>
To avoid the conversion error, set the following options:
CALL xml.Serializer.setOption( "xml_ignoreunknownattributes", TRUE )
CALL xml.Serializer.setOption( "xml_ignoreunknownelements", TRUE )
CALL xml.Serializer.DomToVariable( doc, data )

The options to relax the serialization cannot apply in complex cases, and the conversion error may still occur.

For more details, see xml.Serializer.SetOption.