[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Question with XSLT: pass parameters to JSP

Subject: Question with XSLT: pass parameters to JSP
From: "Ping Chen" <cecho77@xxxxxxxxxxx>
Date: Wed, 12 Mar 2003 10:52:17 -0500
jsp ping
My questions is that when I use <xsl:for-each select="DataSource"> to get @name of EACH DataSource, how could I pass this value as a parameter to a JSP page? Like in the following "users-attr.xsl". Because every time, it just return me "//DataSource[1]/@name", How could I get "//DataSource[i]/@name"(i=1..n) and pass EACH {@name} to the JSP page?

Another question, when I try to pass two <xsl:variable> to a JSP page as parameters, I met a question with the second parameter:
<a href="nextstep.jsp?p1={$param1}&p2={$param2}">next step</a>


Could anyone please tell me how should I do to get them?

Thanks in advance!

Ping

//users-attr.xsl;
<TABLE BORDER="2">
<TR>
<TD>Name</TD>
<TD>Type</TD>
<TD>Attributes</TD>
<TD>RuleSets</TD>
</TR>
<xsl:for-each select="DataSource">
<TR>
<TD><font color="blue"><xsl:value-of select="@name"/></font><br/></TD>
<TD><font color="blue"><xsl:value-of select="@type"/></font><br/></TD>
<TD><font color="blue"><a href="editAttribute.jsp?dsname={@name}">edit</a></font><br/></TD>
<TD><font color="blue"><a href="editRuleSets.jsp?dsname={@name}">edit</a></font><br/></TD>
</TR>
</xsl:for-each>
</TABLE>


	<xsl:variable name="param1" select="//DataSource[1]/@name"/>
	<xsl:variable name="param2" select="//DataSource[1]/X-RuleSet[1]/@name"/>

<a href="nextstep.jsp?p1={$param1}&p2={$param2}">next step</a>

//users-attr.xml;

<?xml version="1.0" encoding="UTF-8"?>
<?xml:stylesheet type="text/xsl" href="users-attr.xsl"?>
<!DOCTYPE PMML PUBLIC "Vacuum 1.0" "users.dtd">
<PMML version="2.0">
<Header/>
<DataSource name="ds1" type="database">
<X-Database driver="sun.jdbc.odbc.JdbcOdbcDriver" password="user" table="t1" url="jdbc:odbc:test" username="user"/>
<DataDictionary numberOfFields="2">
<DataField isCyclic="0" name="a" optype="continuous"/>
<DataField isCyclic="0" name="b" optype="continuous"/>
</DataDictionary>
<X-RuleSet name="rs1">
<X-Rule name="r1" type="bin">
<X-BinaryRule lag="1" leftSide="a" operator="lt" rightSide="b" type="laggedAttribute" useGrouping="0"/>
</X-Rule>
<X-Rule name="r2" type="bin">
<X-BinaryRule lag="0" leftSide="a" operator="lt" rightSide="b" type="attribute" useGrouping="0"/>
</X-Rule>
<X-Rule name="r3" type="bin">
<X-BinaryRule lag="0" leftSide="a" operator="lt" rightSide="3" type="value" useGrouping="0"/>
</X-Rule>
<X-Rule name="r4" type="cond">
<X-ConditionalRule attribute="a" useGrouping="0">
<X-Literal>AND</X-Literal>
<X-Literal>(</X-Literal>
<X-Literal>
<X-BinaryRule lag="0" leftSide="a" operator="gt" rightSide="1.0" type="value" useGrouping="0"/>
</X-Literal>
<X-Literal>)</X-Literal>
<X-BinaryRule lag="0" leftSide="a" operator="gt" rightSide="1.0" type="value" useGrouping="0"/>
</X-ConditionalRule>
</X-Rule>
<X-Rule name="rrrrr" type="bin">
<X-BinaryRule lag="0" leftSide="a" operator="lt" rightSide="1" type="value" useGrouping="0"/>
</X-Rule>
</X-RuleSet>
</DataSource>
<DataSource name="ds2" type="database">
<X-Database driver="sun.jdbc.odbc.JdbcOdbcDriver" password="user" table="t1" url="jdbc:odbc:test" username="user"/>
<DataDictionary numberOfFields="2">
<DataField isCyclic="0" name="a" optype="continuous"/>
<DataField isCyclic="0" name="b" optype="continuous"/>
</DataDictionary>
<X-RuleSet name="rs1">
<X-Rule name="r1" type="bin">
<X-BinaryRule lag="1" leftSide="a" operator="lt" rightSide="b" type="laggedAttribute" useGrouping="0"/>
</X-Rule>
<X-Rule name="r2" type="bin">
<X-BinaryRule lag="0" leftSide="a" operator="lt" rightSide="b" type="attribute" useGrouping="0"/>
</X-Rule>
<X-Rule name="r3" type="bin">
<X-BinaryRule lag="0" leftSide="a" operator="lt" rightSide="3" type="value" useGrouping="0"/>
</X-Rule>
<X-Rule name="r4" type="cond">
<X-ConditionalRule attribute="a" useGrouping="0">
<X-Literal>AND</X-Literal>
<X-Literal>(</X-Literal>
<X-Literal>
<X-BinaryRule lag="0" leftSide="a" operator="gt" rightSide="1.0" type="value" useGrouping="0"/>
</X-Literal>
<X-Literal>)</X-Literal>
<X-BinaryRule lag="0" leftSide="a" operator="gt" rightSide="1.0" type="value" useGrouping="0"/>
</X-ConditionalRule>
</X-Rule>
<X-Rule name="rrrrr" type="bin">
<X-BinaryRule lag="0" leftSide="a" operator="lt" rightSide="1" type="value" useGrouping="0"/>
</X-Rule>
</X-RuleSet>
</DataSource>
</PMML>




_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.