Skip to main content
Inspiring
February 13, 2018
Answered

FrameMaker > XML

  • February 13, 2018
  • 1 reply
  • 1218 views

Hi,

I am exporting fm document to xml using following code

    IntT index;

    F_PropValsT params, *returnParamsp = NULL;

    F_ObjHandleT activeDocId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);

    params = F_ApiGetSaveDefaultParams();

    index = F_ApiGetPropIndex(&params, FS_FileType);

    params.val[index].propVal.u.ival = FV_SaveFmtXml;

    StringT fmFilePath = "C:\\store\\newFM.xml"

    F_ApiSave(activeDocId, fmFilePath, &params, &returnParamsp);

    F_ApiDeallocatePropVals(&params);

    F_ApiDeallocatePropVals(returnParamsp);

Able to get xml file successfully but it ignores text frame and convert anchor frame to an image.

Is there any ways to get these too as part of xml text?

Thanks in advance.

Best Regards,

Paresh

This topic has been closed for replies.
Correct answer Russ Ward

Paresh,

Do you have a structure application defined for the file? That is, the ruleset for conversion to XML? Your code does not reference one (that is, you did not set FS_StructuredSaveApplication). It would be the structure application that handles these details, not the FDK F_ApiSave() code.

Russ

1 reply

Russ WardCorrect answer
Legend
February 13, 2018

Paresh,

Do you have a structure application defined for the file? That is, the ruleset for conversion to XML? Your code does not reference one (that is, you did not set FS_StructuredSaveApplication). It would be the structure application that handles these details, not the FDK F_ApiSave() code.

Russ

Inspiring
February 14, 2018

Hi Russ,

Thanks for the pointers. No I don't have structure defined for the file. I am trying with std fm file created using templates.

I tried using XDocBook for FS_StructuredSaveApplication but got no difference in output.

I am referring your suggestion Re: Breaking change in F_ApiSimpleSave saving documents in FrameMaker12

I presume I am messing up the ruleset value. Could you please tell me what all are valid values for structApp.

Paresh

Legend
February 14, 2018

Paresh, this is a very complicated topic, perhaps as complicated as any related to FrameMaker. To import or export XML from FrameMaker, you need a structure "application," which has many components that define rules for the translation. If you are using a standard structure definition like DocBook or DITA, you can use the structure apps that come with FrameMaker. Otherwise, you have to build your own. This is no trivial matter. If you are committed to this effort, I would suggest that you get a copy of the FrameMaker Structure Developer's Guide and reserve lots of time to get it figured out. There is not much more I can do for you in this forum, other than to answer very specific questions if you have them along the way.

Russ