Using XML Initialization Settings
The AbtXmlConfiguration singleton object is used to reference initialization information from an application's .ini file. You can add any desired XML related constants to the [Xml] section of an .ini file. To determine where XML resources are located, use the predefined setting DefaultResourceQualifier in applications.
For example:
[Xml]
DefaultResourceQualifier=http://vasthost/xml
sstwsdl.xsd=http://vashost/wsdlschema.xsd
PrintTypesEnabled=false
The VA Smalltalk XML support uses the settings from the AbtXmlConfiguration to initialize various runtime behaviors. Below is a list of the predefined keys that are resolved from the active AbtXmlConfiguration. Users can add associations to the [Xml] stanza and reference these associations in their applications.
Table 1.
| | |
DefaultResourceQualifier | The default location where XML parser attempts to locate resources | image startup directory |
MappingExceptionsEnabled | Boolean value that is set to true if mapping exceptions should be signalled | false |
ParserDecodingEnabled | Boolean value that is set to true if the code page conversion should be performed on incoming XML streams | true |
PrintTypesEnabled | Boolean value that is set to true if xsi:type information should be printed with rendered XML elements | true |
SchemaDefinitionDefaultUri | The schema definition namespace URI | |
SchemaInstanceDefaultUri | The schema instance namespace URI | |
StreamFormattingEnabled | Boolean value that is set to true if rendered XML stream contents should include tabs, carriage returns, etc. | true |
Note:
Unsupported XML code page encodings
The XML parser automatically performs code page conversion before attempting to parse an XML stream. Many code pages are handled seamlessly using the default code page conversion routine of the runtime operating system. However, there are some character encodings that cannot be converted. Unsupported code page conversions cause walkbacks at execution time. The following code pages are not supported:
o EUC_JP conversion is not properly supported by native Windows code page routines.
o The code page ISO-2022-JP is not supported by native routines
The VA Smalltalk XML support attempts to map XML character set encodings to valid code pages. The default mappings can be overridden using the API shown in the following example:
AbtXmlStreamConverter mapEncoding: 'UTF-8' toCodePage: 65001.
VA Smalltalk uses the code page conversion support APIs that are built in to each of the supported platforms. Therefore, code page mappings may be different for different operating systems. If you encounter a debugger with the following message it is likely that you have encountered an unmapped or mismapped encoding.
Abt.Nls.160.e: Conversion from code page <sourceCodePage> to code page <targetCodePage> is not
supported.
The following code demonstrates some of the API for AbtXmlConfiguration.
AbtXmlConfiguration current
booleanPropertyNamed: 'PrintTypesEnabled' ifAbsent: [true ].
AbtXmlConfiguration current
propertyNamed: 'DefaultResourceQualifier'.
AbtXmlConfiguration current
defaultResourceQualifier.
AbtXmlConfiguration current
addProperty: 'VAST' named: 'MyCustomProperty'.
AbtXmlConfiguration current
propertyNamed: 'MyCustomProperty'.
Note:
Each time the image is started, the AbtXmlConfiguration is refreshed so that resources set via the addProperty:named: must be redeclared.
Last modified date: 05/14/2020