XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
rahul guruSubject: Passing variables from JSP to XSLT ?
Author: rahul guru
Date: 15 Apr 2005 06:43 AM
hi,
I have to search in the text in a tag in xml that would make use of a user entered text in a jsp page.
My Question:
Is there any way I can pass a string (or anything) from a JSP page to an XSLT page ???

Postnext
(Deleted User) Subject: Passing variables from JSP to XSLT ?
Author: (Deleted User)
Date: 15 Apr 2005 07:42 AM
Hi Rahul,
passing the value for an external variable is an implementation-dependent operation; if, as I guess, you are using Xalan-J, have a look at the jspSample.jsp that ships with it (or read online from http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-xalan/java/samples/servlet/jspSample.jsp)

Hope this helps,
Alberto

Postnext
rahul guruSubject: Passing variables from JSP to XSLT (Using JSTL)?
Author: rahul guru
Date: 15 Apr 2005 08:30 AM
HI,
Thanks Alberto for your quick response.

Actually, I am using JSTL for this project for converting RSS feeds to voicexml format. So, I am not using any kind of parsers directly.
The XSL file is doing its job. Now, I want to use a string variable, only that would be looked for in the Title tags of RSS (using XPath). This is working if I am using hard coded text. But, I want to pass it through JSP.
Here's some simple code for JSP:
____________

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>

<!-- <%
//String strRssUrl = request.getParameter("rssurl");
String strRssUrl = "http://rss.cnn.com/rss/cnn_topstories.rss";
%>
-->

<?xml version="1.0"?>
<vxml version="2.0" application="rss_db4.jsp">

<c:set var="xml">

<!DOCTYPE project [
<!ENTITY included SYSTEM "http://rss.cnn.com/rss/cnn_tech.rss">
]>

<root>
&included;
</root>
</c:set>
<form id="rss_db">
<block>
<c:set var="xsl">
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="/xml/WorkingParsing/parse.xsl" />

</xsl:stylesheet>
</c:set>

<x:transform doc="${xml}" docSystemId="foo.xml" xslt="${xsl}"/>

</block>
</form>
</vxml>
______________
Please, also bear with me as I am using XML, XSLT, VoiceXML for the first time.


Thanks,
Rahul.

Posttop
(Deleted User) Subject: Passing variables from JSP to XSLT (Using JSTL)?
Author: (Deleted User)
Date: 15 Apr 2005 09:19 AM
Hi Rahul,
as you are using JSTL, the most suitable place to look for is the JSTL documentation.
You can find here (http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/x/tld-summary.html) the documentation for the XML-related tags.

Given what they say, your JSP should be

<x:transform doc="${xml}" docSystemId="foo.xml" xslt="${xsl}">
<x:param name="param1" value="${jspVar}"/>
</x:transform>

Alberto

   
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.