Published on InterSystems Developer Community (https://community.intersystems.com)

Home > How to canonicalize XML enabled classes?

Question
Dominic Chui · Jan 3, 2023

How to canonicalize XML enabled classes?

I have a registered object class that extends %XML.Adaptor and I want to convert an object of it into canonical XML. 

From reading the documentation and some trial and error, it seems like I would need to use %XML.Writer to write the object to XML first using the RootObject() method, then read it with %XML.Reader, and then use the Canonicalize() method of %XML.Writer to write it out again.

Is there a better approach?

#XML #Caché
Product version: Caché 2017.1

Source URL:https://community.intersystems.com/post/how-canonicalize-xml-enabled-classes