func (a *Activity) Eval(ctx activity.Context) (done bool, err error) {
	input := &Input{}
	err = ctx.GetInputObject(input)
	if err != nil {
		return true, err
	}
	// fmt.Println("Inside xsltactivity Eval")
	fmt.Println("Going to create temp file")

	// ctx.Logger().Debugf("Input: %s", input.Xml)
	xml, xmlErr := ioutil.TempFile("", "xml")
	if xmlErr != nil {
		fmt.Println("Going to create temp file - Error: ", xmlErr)
		return false, xmlErr
	}
	defer os.Remove(xml.Name())

	fmt.Println(xml.Name())

	fmt.Println("Temp file created, going to write")

	_, xmlWriteErr := xml.WriteString(input.Xml)
	if xmlWriteErr != nil {
		fmt.Println("Temp file created, going to write - Error: ", xmlWriteErr)
		return false, xmlWriteErr
	}

	fmt.Println("String written, lets execute")

	cmd := exec.Cmd{
		Args: []string{"xsltproc", input.XslFile, xml.Name()},
		Env:  os.Environ(),
		Path: "/usr/bin/xsltproc",
	}

	xmlString, cmdErr := cmd.Output()
	if cmdErr != nil {
		fmt.Println("Error running CMD: ", cmdErr)
		return false, cmdErr
	}

	// xmlString := "Boo!"

	output := &Output{OutputXml: string(xmlString)}
	err = ctx.SetOutputObject(output)
	if err != nil {
		return true, err
	}

	return true, nil
}
// Eval implements api.Activity.Eval - Logs the Message
Eval implements api.Activity.Eval - Logs the Message
// Eval implements api . Activity . Eval - Logs the Message
func (a *Activity) Eval(ctx activity.Context) (done bool, err error) {
	input := &Input{}
	err = ctx.GetInputObject(input)
	if err != nil {
		return true, err
	}
	fmt.Println("Going to create temp file")
	xml, xmlErr := ioutil.TempFile("", "xml")
	if xmlErr != nil {
		fmt.Println("Going to create temp file - Error: ", xmlErr)
		return false, xmlErr
	}
	defer os.Remove(xml.Name())
	fmt.Println(xml.Name())
	fmt.Println("Temp file created, going to write")
	_, xmlWriteErr := xml.WriteString(input.Xml)
	if xmlWriteErr != nil {
		fmt.Println("Temp file created, going to write - Error: ", xmlWriteErr)
		return false, xmlWriteErr
	}
	fmt.Println("String written, lets execute")
	cmd := exec.Cmd{
		Args: []string{"xsltproc", input.XslFile, xml.Name()},
		Env:  os.Environ(),
		Path: "/usr/bin/xsltproc",
	}
	xmlString, cmdErr := cmd.Output()
	if cmdErr != nil {
		fmt.Println("Error running CMD: ", cmdErr)
		return false, cmdErr
	}
	output := &Output{OutputXml: string(xmlString)}
	err = ctx.SetOutputObject(output)
	if err != nil {
		return true, err
	}
	return true, nil
}
func ( a * Activity ) Eval ( ctx activity . Context ) ( done bool , err error ) { input := & Input { } err = ctx . GetInputObject ( input ) if err != nil { return true , err } fmt . Println ( " " ) xml , xmlErr := ioutil . TempFile ( " " , " " ) if xmlErr != nil { fmt . Println ( " " , xmlErr ) return false , xmlErr } defer os . Remove ( xml . Name ( ) ) fmt . Println ( xml . Name ( ) ) fmt . Println ( " " ) _ , xmlWriteErr := xml . WriteString ( input . Xml ) if xmlWriteErr != nil { fmt . Println ( " " , xmlWriteErr ) return false , xmlWriteErr } fmt . Println ( " " ) cmd := exec . Cmd { Args : [ ] string { " " , input . XslFile , xml . Name ( ) } , Env : os . Environ ( ) , Path : " " , } xmlString , cmdErr := cmd . Output ( ) if cmdErr != nil { fmt . Println ( " " , cmdErr ) return false , cmdErr } output := & Output { OutputXml : string ( xmlString ) } err = ctx . SetOutputObject ( output ) if err != nil { return true , err } return true , nil }
Eval implements api.Activity.Eval - Logs the Message
Eval implements api . Activity . Eval - Logs the Message
// fmt.Println("Inside xsltactivity Eval") // ctx.Logger().Debugf("Input: %s", input.Xml) // xmlString := "Boo!"