Hey everyone,
Still fairly new to this but I want to add to my object, before I transform, a parameter which I have declared in my XSL document.
Here is the JSP code:
<%@page contentType="text/html"%>
<%@page errorPage="error.htm"%>
<%@page import="javax.xml.transform.TransformerFactory"%>
<%@page import="javax.xml.transform.Transformer"%>
<%@page import="javax.xml.transform.stream.StreamSource"%>
<%@page import="javax.xml.transform.stream.StreamResult"%>
<HTML>
<%
String org = request.getParameter("org");
if(org != null){
String xml=" org+ ".xml";
Sring xmlRef=xml;
String xsltRef=" TransformerFactory tFactory = TransformerFactory.newInstance();
StreamSource xsltSource = new StreamSource(xsltRef);
Transformer transfomer = tFactory.newTransformer(xsltSource);
StreamSource xmlSource = new StreamSource(xmlRef);
StreamResult outToBrowser = new StreamResult(out);
transformer.transform(xmlSource, outToBrowser);
}
else{
same as above except using a default xml page
}
%>
</HTML>
So i need to have a transform.addParameter or setParameter before I outsource it and I am not sure of the proper syntax on the method I need to use. I need to send it the value of org which was originally sent to the JSP file. The reason for this is I need to use it within the XSL document in order to reprocess the JSP again when a link is clicked.
Second question:
in my XSL I have <xsl
aram name="org">value</xsl
aram> How do I reference this later in the document??
Thanks in advance just kinda starting to get a hang of all this.
Thanks in advance,
Phil
Still fairly new to this but I want to add to my object, before I transform, a parameter which I have declared in my XSL document.
Here is the JSP code:
<%@page contentType="text/html"%>
<%@page errorPage="error.htm"%>
<%@page import="javax.xml.transform.TransformerFactory"%>
<%@page import="javax.xml.transform.Transformer"%>
<%@page import="javax.xml.transform.stream.StreamSource"%>
<%@page import="javax.xml.transform.stream.StreamResult"%>
<HTML>
<%
String org = request.getParameter("org");
if(org != null){
String xml=" org+ ".xml";
Sring xmlRef=xml;
String xsltRef=" TransformerFactory tFactory = TransformerFactory.newInstance();
StreamSource xsltSource = new StreamSource(xsltRef);
Transformer transfomer = tFactory.newTransformer(xsltSource);
StreamSource xmlSource = new StreamSource(xmlRef);
StreamResult outToBrowser = new StreamResult(out);
transformer.transform(xmlSource, outToBrowser);
}
else{
same as above except using a default xml page
}
%>
</HTML>
So i need to have a transform.addParameter or setParameter before I outsource it and I am not sure of the proper syntax on the method I need to use. I need to send it the value of org which was originally sent to the JSP file. The reason for this is I need to use it within the XSL document in order to reprocess the JSP again when a link is clicked.
Second question:
in my XSL I have <xsl


Thanks in advance just kinda starting to get a hang of all this.
Thanks in advance,
Phil