Page 1 of 1

Using XSL with GoAnywhere

Posted: Tue Mar 18, 2014 8:29 am
by Tom Buettner
There doesn't seem to be any GoAnywhere task to transform XML with XSL, is there a recommended way to go about this? Sometimes we have XML that we get that we don't have control over and need to reformat it or translate values and some scenarios XSL seems to be a good option.

Re: Using XSL with GoAnywhere

Posted: Tue Apr 08, 2014 3:47 pm
by Support_Jon

XSL schema validation is supported on both the Read XML and Write XML tasks in projects within GoAnywhere Director. However translation isn't a direct feature of those tasks.

Regardless, it may be possible to still accomplish what you need by reading in the schema and doing the translation as part of the project.

Can you provide a bit more detail as to what all is taking place as part of this transformation schema?

Thanks - Jon

Re: Using XSL with GoAnywhere

Posted: Mon Apr 14, 2014 4:04 am
by Jonathan
Hi Tom,

There is no built in method for Director to do XSL transformations (or at least not that I have found), You could look at an external tool to do this for you that accepts command line args and run it as a native command during your project.

Re: Using XSL with GoAnywhere

Posted: Mon Apr 14, 2014 11:17 am
by Tom Buettner
I have an XML file that needs "reformatting" and values translated. I was given an XSL from that did the value translation and updated it to output the XML how I want it. For my proof of concept I did an Exec Task (Director is running on Windows) that calls a .BAT file which runs a VBScript (.vbs) that does the XSL transform and writes the output XML file. I could not figure out any way to pass parameters to the Exec Task so the .BAT file has hard coded path to where to run the VBScript. I hope there is I better way to do this.

Re: Using XSL with GoAnywhere

Posted: Mon Apr 14, 2014 12:53 pm
by Support_Rick

Passing parameters to a .BAT file is accomplished by adding the ARG element to the Exec Task. Here is a link to another Forum Post that might better help you out...

How to Execute Powershell Script with Parameters

Basically, you create your EXEC Task, then click on the Next Button and select the option for an Argument. In relative terms, there will be an Argument entry for each Parameter passed (ie, if there's a space between arguments/parameters) then there will need to be another Argument added for the next one.

MyBatFile.bat Parm1 Parm2 Parm3

Would be executed like:
Code: Select all
      <exec label="Execute MyBatFile" executable="C:\Temp\MyBatFile.bat" workingDir="C:\Temp" version="1.0">
         <arg value="${Parm1}" />
         <arg value="${Parm2}" />
         <arg value="${Parm3}" />

Re: Using XSL with GoAnywhere

Posted: Mon Apr 14, 2014 12:55 pm
by Jonathan
The only better way I can think of would be to put in a request to Linoma to get the feature added in a later version or look at the custom tasks option if you know your way around Java.