|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RE: [none] (Wendy's question)
My poor-man's solution to this at the moment is
using a JSP page to dynamically return a stylesheet
including a parameter passed in from the HTTP request.
In the example below, the stylesheet uses the
<%= request.getParameter("cat") %>
to plug in the value of the HTTP request parameter named
"cat" into my stylesheet.
When I want to use the stylesheet, I refer to it by URL
like:
http://mymachine.com/MyStyleSheet.jsp?cat=Foobar
and the right sheet is returned.
Having XSL constants whose values could be set by the
processor ahead of time would be a more elegant solution
to this.
+--- MyStyleSheet.jsp ------------------------------------------
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"
xmlns="http://www.w3.org/TR/REC-html40"
result-ns="">
<xsl:template match="/">
<xsl:for-each select="Site/Category">
<xsl:if test='.[Name="<%= request.getParameter("cat") %>"]'>
<!-- above is JSP syntax -->
:
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
____________________________________________________________
Steve Muench, Consulting Product Mgr & XML Evangelist
Java Business Objects Dev't Team - http://www.oracle.com/xml
--- Begin Message ---
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








