Copy link to clipboard
Copied
What is the syntax for calling XSLT transformations with ExtendScript's CallClient method? An example would be helpful.
Also, are there any other undocumented methods or properties that have been recently added? I was disappointed about not knowing about this before. Adobe guys, please let us power users know when there are new features in ExtendScript. Thank you very much.
-Rick
1 Correct answer
Here's a syntax example if you're still interested:
CallClient("FmXSLT","XSLTRunTrScenario -file 'c:\\temp\\input.xml' -xslfilepath 'c:\\temp\\export.xslt' -outputfilepath 'c:\\temp\\out.xml'");
The article on the blog also mentioned an argument "-processor". I tried "-processor XALAN", but FM appears to be using the default XSLT processor (SAXON in my case) anyway.
Copy link to clipboard
Copied
Hi Rick,
just a few days ago we published this nice article from 4everJang on the Adobe TechComm blog:
XSLT Support in FrameMaker 2017
See especially this section in the post:
XSLT Support in FrameMaker 2017 – Making XSLT part of your ExtendScript automation
Cheers,
*Stefan.
Copy link to clipboard
Copied
Hi Stefan, Yes I saw the blog post and that is why I posted here. I need some details on the exact syntax to use. And I was hoping for an example or two. Thanks. -Rick
Copy link to clipboard
Copied
Here's a syntax example if you're still interested:
CallClient("FmXSLT","XSLTRunTrScenario -file 'c:\\temp\\input.xml' -xslfilepath 'c:\\temp\\export.xslt' -outputfilepath 'c:\\temp\\out.xml'");
The article on the blog also mentioned an argument "-processor". I tried "-processor XALAN", but FM appears to be using the default XSLT processor (SAXON in my case) anyway.
Copy link to clipboard
Copied
I was able to use this to solve a vexing use case ... so I'm grateful!
Possibly an uninformed question, but serious ... how would one figure out the required client name and arguments in the absence of Jang's blog post? Is this discernible from anything in the FrameMaker installation or FDK? I'm curious about both this specific case, and the general case (what clients can I call from ExtendScript, and what is the required syntax for doing so?).
-Alan
Copy link to clipboard
Copied
I don't think it's possible to write an API client call without having some form of documentation (or prior knowledge).
The name of an API client is less of a secret. You can find it in the maker.ini file:
[APIClients]
;------------------------------ API Clients ------------------------------
; scroll down and somewhere you'll find ...
FmXSLT=Standard, Central client for XSL transformation, fminit\XSLT.dll,structured
One could actually define a different name in the maker.ini file. After restarting FM, the API client would be available under its new name. (I don't suggest you should do this, it's just a demonstration that the client name is not hard-coded.)
abcde=Standard, Central client for XSL transformation, fminit\XSLT.dll,structured
// Extendscript:
CallClient("abcde","XSLTRunTrScenario -file 'c:\\temp\\input.xml' -xslfilepath 'c:\\temp\\export.xsl' -outputfilepath 'c:\\temp\\out.xml'");
Copy link to clipboard
Copied
I neglected to thank you for your answer. I feared that I was missing something. Good to know I wasn't.
-Alan

