We have been able to parse an XML feed from an outside source
(YellowBrix) with the following JSP code:
<%@ page language="java" %>
<%@ page import="java.io.InputStream" %>
<%@ page import="java.net.URL" %>
<%@ page import="javax.xml.transform.*"%>
<%@ page import="javax.xml.transform.stream.*"%>
<html>
<body>
<%
String link = "http://...your external link here...";
URL url = new URL(link);
InputStream f = url.openStream();
String xslFile = "news.xsl";
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new
StreamSource(xslFile));
transformer.transform( new StreamSource(f), new StreamResult(out));
%>
</body>
</html>
I didn't want to spend all day trying to make Jetspeed happy with the
path to the stylesheet, so I set up the JSP, ran it and checked the
error for the path in the "news.xml not found" message. In our case, it
was looking in the WEB-INF/conf directory but I can't tell you exactly
why it's looking there. Your instance may look elsewhere depending on
configuration settings.
Jim Schultz
Jeffrey Owens wrote:
>I am accessing a java class on another server and returning xml. I want to use xsl to
>transform xml into html, but I cant' get jsp to recognize stylesheet, within the jsp
>or the xreg file. I'm probably going at this backward and need to reengineer my whole
>approach, but if anyone has any ideas I'd appreciate comment.
>
>
>
>
>Jeffrey Owens
>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>