You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by David Trum <Da...@intellinet.com> on 2001/02/06 16:55:23 UTC
XSLT Question
I'm new to the mailing list and to XSL. I got the examples working as
written, but I was wondering if there is already a way to do the following
things:
* pass parameters to a stylesheet
* pass the results of one transformation to another (chaining)
* have the xml input be a URL instead of a local file name (so I could
get data from MS SQL2K directly)
Included is a nice xml/xsl combo of the U.S. Constitution, where if we can
pass parameters, then the transformation would return only the indicated
page.
Thanks in advance.
BTW, I'm using Tomcat 3.2 on Win2K and Mandrake 7.2.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office"
/>
David Trum
Principal Consultant
Intellinet - www.intellinet.com
Seven years of success built on promises kept.
3475 Lenox Road
Atlanta, GA 30326
404.442.8000
404.442.8001 fax
Re: XSLT Question
Posted by Boyd Waters <bw...@aoc.nrao.edu>.
David:
I use the XSLT taglib to do these things in my content-management site.
> pass the results of one transformation to another (chaining)
simply next xsl taglibs; from my home page:
<!-- news channels -->
<hr />
<xsl:apply xsl="/xsl/recent-links.xsl">
<xsl:apply xsl="/xsl/rdf-to-dl.xsl">
<xsl:apply xsl="/xsl/rss09-to-10.xsl">
<xsl:include page="http://slashdot.org/slashdot.rdf"/>
</xsl:apply>
</xsl:apply>
</xsl:apply>
> have the xml input be a URL instead of a local file name
I tweaked the IncludeTag.java source to do this, but it got over-written
by my last update -- doh! But in short, what you'd do is remove the
lines of code that throw an exception if the page attrib doesn't begin
with '/', and also remove the lines of code that build an explicit URL
from the page attrib. I've attached the hacked source to this email.
Note that with this modification in place, the page attrib MUST be a
fully-qualified, valid URL... not a relative one.
The XSLT stylesheets in the example are at
http://www.aoc.nrao.edu/~bwaters/pub/xsl
and most of them were developed by Eric van der Vlist (http://4xt.org)
Be careful: the xalan XSLT processor can accept stylesheets that attempt
to execute arbitrary java code on your server. So if you accept
stylesheets as URIs, that's maybe a vector for code exploits. (Durn. me
and my big mouth).
Hope this helps,
-- boyd
---------
Boyd Waters bwaters@nrao.edu
National Radio Astronomy Observatory http://www.nrao.edu
PO Box 0 Socorro, NM 87801 505.835.7346
http://www.zocalo.net/~waters
waters@zocalo.net
---------