Skip to main content
Inspiring
November 9, 2021
Question

Readd and write XML files in FDK

  • November 9, 2021
  • 2 replies
  • 1035 views

Hi,

In my FDK client, I need to read an XML file and according to the user's actions, make some changes in the XML file. I wonder if is there any library which you used or you can suggest? I really had problem finding one which works compatible with FDK. 

Thank you in advance,

Sanam

This topic has been closed for replies.

2 replies

frameexpert
Community Expert
Community Expert
November 9, 2021

You might consider using XSLT to transform the XML file. FrameMaker has a couple of XSLT processors built in, including Saxon Enterprise Edition. These processors can be invoked through the FDK and ExtendScript. Here is an article that explains how to do it in ExtendScript, but you should be able to translate the instructions to FDK code.

https://blog.adobe.com/en/publish/2017/11/21/xslt-support-in-framemaker-2017

 

I particularly like XSLT because it is a W3C standard and I can do my development outside of FrameMaker in Oxygen XML editor. Once I get the desired output in Oxygen with my XSLT, I can plug it into my FrameMaker workflow. For me, that usually involves ExtendScript; in your case, the FDK.

sanam.dehAuthor
Inspiring
November 10, 2021

@frameexpert Thanks for you reply. Actually I don't want to transform my XML file to any other format. I just want to read it in background and make some changes. 

frameexpert
Community Expert
Community Expert
November 10, 2021

XSLT can make changes to XML. If you post a small before/after sample of the XML, I can post the XSLT code.

JonBe
Inspiring
November 9, 2021

Hi Sanam,

 

Do you want to read a XML file that FrameMaker has saved? If so, so long as the structured application has been set up properly you can use FrameMaker directly.

 

If it is not a FrameMaker saved XML file, or does not have a structured application, which I suspect is your requirement, then I suggest you look at implementing pugixml.org - Home. I have found this library brilliant for all the configuration stuff my clients plugins require. It works without problems with c++ plugins for FM15.

 

Jon

sanam.dehAuthor
Inspiring
November 9, 2021

First of all, Thank you Jon for replying to my question.

Actually I want to open an XML file which is not created by FrameMaker. I take a look at the library you suggested.