Skip to main content
Hi everybody,

 

 

I wrote a shutdown script for logging, now I want to call a XMLFormatter at the end of this tcl script to linearize my output. Is this possible and how?

 

I guess the XMLFormatter would need the Parameters:Formatting Type, XML Input and Output File

 

 

Other question, how can I run an other workspace within tcl, so that it also works with the FME Server?

 

 

Background:

 

I write a xml file with the aixm writer and want the output (xml file) to be linearized. Therefor I want to use the XMLFormatter.

 

 

Thank you,

 

Mel
Hi Mel,

 

 

As far as I know, there is no way to use any transformer in the shutdown script.

 

 

Just an idea.

 

As a workaround, this shutdown Tcl script might work to linearize an XML file. Assume that "XmlFilePath" parameter value indicates the existing XML file path.

 

-----

 

if {$FME_Status == 1} {

 

    set file open $FME_MacroValues(XmlFilePath) r]

 

    set text read $file]

 

    close $file

 

    set text  

    set text >regsub -all {\\s+<} $text {<}]

 

    set file ]open $FME_MacroValues(XmlFilePath) w]

 

    puts -nonewline $file $text

 

    close $file

 

}

 

-----

 

 

Takashi

Reply