Thanks for the previous replies.
What I am trying to do is convert an old program I wrote using the Tamino 2.x API to the new Tamino 3.x Java API. I figured I would get the Document back from Tamino as a DOM and serialize it to a string:
serializer.setOutputCharStream(returnedQuery);
serializer.serialize(TaminoDOMdoc);
// for XML display testing purposes
//out.print(returnedQuery.toString());
This prints the XML document to the Web page perfectly. When I try and use the JAXP 1.0 API from Sun and apply a Stylesheet, I get the following error displayed in my Java Servlet on screen:
java.net.MalformedURLException: no protocol: <?xml version="1.0"?>
My Java Servlet code snippet is the following:
TransformerFactory tFactory = TransformerFactory.newInstance();
// Get the XML input document and the stylesheet.
Source xmlSource = new StreamSource(returnedQuery.toString());
Source xslSource = new StreamSource(Liststylesheet);
// Generate the transformer.
Transformer transformer = tFactory.newTransformer(xslSource);
// Perform the transformation, sending the output to the response.
transformer.transform(xmlSource, new StreamResult(out));
Seems that the error happens at transformer.transform(xmlSource, new StreamResult(out));
All I want to do is apply a Stylesheet (Liststylesheet) to the XML Document (returnedQuery.toString())
If anyone has any suggestions on why this is not working, or if I should do it a better way, please let me know.
I know that the styleesheet and XML file work, because if I copy the displayed XML to XML Spy and apply the exact Stylesheet, it renders perfectly.
Thanks in advance,
Brian Garner
Thanks,
Brian Garner
Advisory Systems Engineer, Softtware AG Canada
416.364.1133 x.261 office
#API-Management#webMethods-Tamino-XML-Server-APIs#webMethods