I am exporting fm document to xml using following code
F_PropValsT params, *returnParamsp = NULL;
F_ObjHandleT activeDocId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
params = F_ApiGetSaveDefaultParams();
index = F_ApiGetPropIndex(¶ms, FS_FileType);
params.val[index].propVal.u.ival = FV_SaveFmtXml;
StringT fmFilePath = "C:\\store\\newFM.xml"
F_ApiSave(activeDocId, fmFilePath, ¶ms, &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.
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.
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, 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.
Thanks Russ. You pointers helped me. I decided to create my own custom xml (by traversing flow/frames/pgs/textitems) instead of getting into complexity of structure application and rule translation.
Paresh, that is definitely one way to do it. And, I can where it might be best option in some situations. I'm glad I could help you some. I was afraid that I wasn't very helpful at all, because your question was so big