Portlet Factory, Version 6.1.2


 

About processing alternative XML objects stored in variables

Unlike XML variables that contain IXML objects, you need to get and set alternative XML representations using the variables.getObject() or variables.setObject() methods. For example, if you configure an XML Data variable to be a DOM representation, to get the DOM object stored in that variable, you would use code similar to the following:

DOM myDomObject = (DOM)webAccess.getVariables().getObject("myDomVariable");

Note: You must cast to the appropriate object type when using the variables.getObject() method.

Once you retrieve the object, you can call the methods defined by the interface.

To set a variable to contain an alternative XML representation, use code similar to the following:

webAccess.getVariables().setObject("myDomVariable", myDomObject);

Note: The variable whose value you set must be configured to be the appropriate XML representation.

Parent topic: About alternative XML representations


Library | Support |