Hi,

I am trying to create some custom types and tasks, but having a problem getting back the custom task object to reset some values. My custom task is coming in as an UnknownElement. I then try to cast to my object using UnknownElement.getRealThing() (or getTask), but it gives me a null. How do you get a custom task object?


Task[] tasks = target.getTasks();

Target clonedTarget = new Target();
clonedTarget.setProject(lsb);

for (int i=0; i < tasks.length; i++) {
    Task task = tasks[i];
    String name = task.getTaskName();
    if (name.equals("xsltransform")) {
        UnknownElement unElem = (UnknownElement) task;

/*
This next line sets xslTransform == null
*/

        XslTransform xslTransform = (XslTransform) unElem.getRealThing();

        //XslTransform xslTransform = (XslTransform) unElem.getTask();

        xslTransform.setOutputStream(response.getOutputStream());
    }

    clonedTarget.addTask(task);
}

thanks,
-Rob

p.s. I created a XslTemplates top-level type that can be referenced by an XslTransform task. This allows for two things; a cache of templates objects, and the ability to set a URIResolver on the Templates object to resolve xsl:import/include and a URIResolver on the Transformer object to resolve calls from the XSL document function. If anyone is interested I can provide them (though I am sure they would need work...).

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to