A script-enabled browser is required for this page to function properly.

Using the Forms to XML Conversion Tool

The Forms to XML conversion tool, Forms2XML, can be invoked from the command line or from a Java program. The command can be applied to FormsModule (.fmb), ObjectLibrary (.olb), or MenuModule (.mmb) files. You can also use the convenience scripts that are provided with the Forms installation.

The Forms2XML tool produces an XML file that has the same base name as the Forms file with a .xml extension. The extension _fmb, _mmb, or _olb is added to the base file name to indicate whether the original file was a FormModule, MenuModule, or Object Library respectively. The following table displays a few examples of the changes the tool makes to the name of the file being converted:

To use the Forms to XML conversion tool from the command line:

where:

File name before conversion File name after conversion
myForm.fmb myForm_fmb.xml
myMenu.mmb myMenu_mmb.xml
myLibrary.olb myLibrary_olb.xml

 

Option Description
USE_PROPERTY_IDS=YES/NO Setting USE_PROPERTY_IDS to YES causes the Forms to XML conversion tool to write the internal ID for Real or Character into the XML file. The default value (no) generates property value names as before.
OVERWRITE=YES/NO

if OVERWRITE=YES, the tool will overwrite any XML files with the same name that already exist in the output directory.

if OVERWRITE=NO, (default) the tool will not overwrite any XML files with the same name that already exist in the output directory. The tool will stop processing and return the message:

File file already exists. Use argument OVERWRITE=YES to replace.

DUMP=ALL/OVERRIDEN

If DUMP=ALL, the tool dumps all properties

If DUMP=OVERRIDEN, the tool dumps only those properties that are overriden.

 

To use the Forms to XML conversion tool from a Java program:

You can pass the Forms2XML tool a JdapiModule Java object (class oracle.forms.jdapi.JdapiModule) and and dump its objects and properties to an XMLDocument (class oracle.xml.parser.v2.XMLDocument). For example:

...
 // get the modules in the session
 JdapiIterator mods = Jdapi.getModules(); 
    // ... and iterate round them 
    while(mods.hasNext())
      {
        JdapiModule mod = (JdapiModule)mods.next();
        Forms2XML converter = new Forms2XML(mod);
        XMLDocument doc = converter.dumpModule(false);
		...
	}

Note that the Boolean argument taken by the dumpModule() method instructs converter to dump all properties to the XMLDocument doc, not just those which are overridden.

Once you have the module as a XMLDocument object, you could then use the XDK classes to manipulate it. For example, you could traverse it, remove or add objects, change properties, copy objects into other modules that are also saved as XMLDocument objects, and more—all programmatically.

Images

If your form contains graphics objects of type "Image", the image will be exported to file when the form is converted to XML. The filename is constructed from the name of the module, canvas and graphics objects. For
example, if you have a Form Module "EMP" with Canvas "VIEW" and graphics images object "LOGO" the following line will appear when converting the form to XML:

Graphics LOGO image saved as EMP_VIEW_LOGO.tif.

The filename is stored in the XML as an attribute on the graphics object.


Forms to XML USE_PROPERTY_IDS Parameter

About Converting Forms to XML

Understanding the Generated XML

About the Convenience Scripts