Stacking preprocessors in Visual Studio 2019/2022

Looking at documentation for Visual Cobol in Visual Studio 2019/2022 in Developing Applications in the IDE > Building Cobol Applications > Compiling Cobol Applications > Using Preprocessors > Additional Preprocessor

In the section Specifying an additional preprocessor there is a note:

Note: It is not possible to combine the "Micro Focus - EHTML Preprocessor" and "Micro Focus - XML Preprocessor" with other preprocessors. Selecting one of these preprocessors will prevent you from adding any other additional preprocessors. See Integrating Preprocessors into Visual COBOL for instructions about how to integrate an additional preprocessor with the list in Visual COBOL.

My first question is, where is the section "Integrating Preprocessors into Visual COBOL"? Searching for it gives nothing useful.

My second question if this is the case, what are the recommendations for code that handles both oracle (with pro*cobol) and XML (using the XML preprocssor)?

Some experimentation, if the stacking order is

  • XML Preprocessor
  • Oracle Pro*Cobol
  • CP Preprocessor

Intellisense flags all XML as errors, building/compiling works and after a recompile intellisense show no errors until you change something and then all the XML errors return.

Changing the stacking order to

  • Oracle Pro*Cobol
  • CP Preprocessor
  • XML Preprocessor

Intellisense still flags XML as errors, building/compiling fails due to "CP appears more than once in the same preprocessor stack"

With the XML Preprocssor first in the stacking order it is possible to build code in VS/VC but intellisense is pretty useless. So this is me throwing these finding out there to see if someone in the same situation has found a better solution or if someone MF has a recommendation about this subject. I do not  want to put work into a support case just to get told that this is expected behaviour.

Kind regards,

Robert de Mander

Svea Bank AB

  • Verified Answer

    +1  

    Hi Robert,

    Unfortunately, the XML preprocessor was not written as a stackable preprocessor so it cannot be used in conjunction with COBSQL.
    You could compile a subprogram using only the XML preprocessor and call it from a program using COBSQL but the two cannot be used together in the same program.

    There are also alternative XML solutions that you could use like the XML PARSE and XML GENERATE statements or XML Extensions.

    Chris Glazier
    Rocket Software - Principal Technical Support Specialist
    If you found this post useful, give it a “Like” or click on "Verify Answer" under the "More" button

  • 0 in reply to   

    OK, that confirms my suspicions. We will need to rethink this.

    Thanks for the information

    Robert