Using XSL with GoAnywhere

Post any question you may have in regards to GoAnywhere Director and let our talented support staff and other users assist you.
6 posts Page 1 of 1

Tom Buettner

Posts: 2
Joined: Tue Mar 18, 2014 7:42 am

Post by Tom Buettner » Tue Mar 18, 2014 8:29 am
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.

Support_Jon

Support Specialist
Posts: 62
Joined: Thu Jul 19, 2012 9:15 am
Location: Ashland, NE

Post by Support_Jon » Tue Apr 08, 2014 3:47 pm
Tom,

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

Jonathan

Posts: 18
Joined: Wed Jan 02, 2013 5:27 am
Location: Mapledurham, UK

Post by Jonathan » Mon Apr 14, 2014 4:04 am
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.

Tom Buettner

Posts: 2
Joined: Tue Mar 18, 2014 7:42 am

Post by Tom Buettner » Mon Apr 14, 2014 11:17 am
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.

Support_Rick

Support Specialist
Posts: 590
Joined: Tue Jul 17, 2012 2:12 pm
Location: Phoenix, AZ

Post by Support_Rick » Mon Apr 14, 2014 12:53 pm
Tom,

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}" />
      </exec>
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696

Jonathan

Posts: 18
Joined: Wed Jan 02, 2013 5:27 am
Location: Mapledurham, UK

Post by Jonathan » Mon Apr 14, 2014 12:55 pm
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.
6 posts Page 1 of 1