Os-command output to Webstream

Potish

Member
I am testing an simple implementation of XSLT transformation of XML to HTML using Instance Saxon. I am making a os-command call to saxon to do the transformation and need to capture the output and write it a webstream from webspeed. I am not familiar with how to capture the output of the os-command and write it to a webstream. I would appreciate a simple example for getting this done. My current os-command is as follows

define variable vccommand as character.

vccommand = "d:/saxon/saxon xmlfile.xml xslfile.xsl".

os-command no-wait no-console value(vccommand).

I have Webspeed 9.1C running on windows 2003.
 
Thank you MaximMonin for the suggestion.

I have tried two options both of which do not seem to be working.
OPTION 1:

define variable vccommand as character no-undo.
define variable vcoutput as character no-undo.

vccommand = "d:\Saxon\saxon d:\xmlfiles\xmlfilename.xml d:\xslfiles\companylistA.xsl".

input through value(vccommand).
import unformatted vcoutput.
input close.

OPTION 2:
DEFINE STREAM wshtml.
DEFINE VARIABLE vccommand AS CHARACTER NO-UNDO.
DEFINE VARIABLE vcoutput AS CHARACTER NO-UNDO.

vccommand = "d:\Saxon\saxon d:\xmlfiles\xmlfilename.xml d:\xslfiles\xslfilename.xsl".

INPUT-OUTPUT STREAM wshtml THROUGH VALUE (vccommand ) NO-ECHO UNBUFFERED.
IMPORT STREAM wshtml UNFORMATTED vcoutput.
INPUT-OUTPUT STREAM wshtml CLOSE.


Both options seem to be hanging at the input step and eventually shutdown my open session of appbuilder. My development server is Windows 2000 while the production is windows 2003. I have only tried this in development.

Any ideas as to what might be causing the failure?
 
Try

define variable vccommand as character no-undo.
define variable vcoutput as character no-undo.

def stream xx.
output stream to value("scriptfile").
put stream xx unformatted "d:\Saxon\saxon d:\xmlfiles\xmlfilename.xml d:\xslfiles\companylistA.xsl > file.out " skip.
output stream xx close.

os-command value("scriptfile").

Now file.out should contain the output, and you can read it to see the result.

input from value("file.out").
import unformatted vcoutput.
input close.
 
I have made some progress by writing the output of the os-command to a file as a html file. After that I use the lines below to read the file and display content to the web

input stream wshtml from value(vcfilenamehtml) no-echo unbuffered.
repeat:
import stream wshtml unformatted vcoutput.
vcoutput_all = vcoutput_all + vcoutput + "~n".
end.
input stream wshtml close.
{&out} vcoutput_all.

This works for the majority of the html files generated but I am running into two errors with some files. The errors are as follows

1.) Unable to complete automatic datatype conversion . Use STRING, DECIMAL etc functions to do explicit conversion. (5731)
2.) Import data field wider than 65534 character (4138)

The second error is primarily due to the size of the files in question. I have not be able to identify the root cause of the first error, but If I reduce the content of the files causing the first error the error seems to go way.

Problem is I need to display the files in their original size. I am running progress 9.1C on windows 2003 in Prod. Is there anything I can do besides upgrading or reducing file content that I can try to get the files displayed for now?
 
Back
Top