PBDOM enhancements

The PBDOM_Document object has been added with the following two new functions:

After introducing three new arguments (version, encoding, and standalone) to the PBDOM_Document object, the SaveDocument function is changed in the following aspects:

  • The files will be saved by the SaveDocument function in the specified encoding. When creating a new document, the default value of encoding is UTF-16LE. When opening an existing document, the encoding is specified in the declaration of the document. If there is no declaration in the document or no specified encoding in the declaration, the encoding is UTF-16LE by default.

  • If standalone is an empty string, it will be set to "no" by default when saving the string into a disk file. If version is invalid, no declaration will be added. And if encoding is invalid, no exception will be thrown, but an empty document will be generated.

The PBDOM_Attribute and PBDOM_PROCESSINGINSTRUCTION objects have been changed in the following aspects:

  • When creating a PBDOM_ATTRIBUTE object in PowerBuilder 2022, the object contains no child node by default. (This is different from the earlier versions where the object contains a child node by default)

  • The PBDOM_PROCESSINGINSTRUCTION object is no longer supported to add and modify declarations. An exception will be thrown when the node name of PBDOM_PROCESSINGINSTRUCTION is set to "XML".

If PBDOM is used in your application, please follow the instructions in Upgrading PowerBuilder Applications > PBDOM changes to upgrade and modify your application.