Important changes to legacy XML API based on XMLNode

In 9.0, there are important changes to the legacy XML API based on the XMLNode class:

Legacy XML API no longer loads XSDs

The legacy XML API (which is based on the XMLNode class) no longer supports loading an XSD and creating Gosu types from it. This change only affects XSDs that were registered to use the legacy XML API in PolicyCenter 8.0, which required an entry in the configuration file:

config/registry/compatibility-xsd.xml

If you added any lines to that configuration file, you must be aware of the change. Immediately convert your code to use the standard XML API based on XmlElement. See Introduction to the XML element in Gosu.

Because generated XSD types have a different structure with the current XML API, you may get compiler errors to fix the syntax of related code. For example, working with an arbitrary type called MyXMLType, the code MyXMLType.Choice.ComplexType must be change to MyXMLType.ComplexType.

Legacy XML API using untyped XMLNode instances is deprecated

The use of the XMLNode class as untyped XML nodes still works but is deprecated. Do not write new code that uses XMLNode. Begin to convert any XMLNode untyped node code to use the newer XML API based on the XmlElement class.

If you use the deprecated XML API, you might need to make manual changes due to minor package changes. In previous releases, the XMLNode class and the related interface IXMLNode both existed in two packages. In version 9.0, only the gw.xml package is valid for these types. Depending on which package you used, you might need to modify your code:

  • If you used the class gw.api.xml.XMLNode, change all usages to gw.xml.XMLNode.
  • If you used the interface gw.api.xml.IXMLNode, change all usages to gw.xml.IXMLNode.