Result tOutputTarget = null;
// test and convert the flexible parameters
if (aXmlInput instanceof Node) {
// aXmlInput is a DOM object
tXmlSource = new DOMSource((Node)aXmlInput);
} else if (aXmlInput instanceof InputStream) {
// aXmlInput is a InputStream (XML byte stream)
tXmlSource = new StreamSource((InputStream)aXmlInput);
} else if (aXmlInput instanceof Reader) {
// aXmlInput is a Reader (XML character stream)
tXmlSource = new StreamSource((Reader)aXmlInput);
} else if (aXmlInput instanceof String) {
// aXmlInput is an URL (conforming to the URI syntax)
tXmlSource = new StreamSource((String)aXmlInput);
} else {
throw new IllegalArgumentException("HTMLwithXSLBuilder2::transform : Illegal argument for XML input");
}
if (aXslInput instanceof Node) {
tXslSource = new DOMSource((Node)aXslInput);
} else if (aXslInput instanceof InputStream) {
tXslSource = new StreamSource((InputStream)aXslInput);
} else if (aXslInput instanceof Reader) {
tXslSource = new StreamSource((Reader)aXslInput);
} else if (aXslInput instanceof String) {