Solved

multiple XSLT transformations with JSTL 1.0

Posted on 2004-08-10
5
794 Views
Last Modified: 2013-11-24
I have a working website that gets the content out of an XML file with JSTL 1.1. Prior to displaying it, MULTIPLE XSLT transformations occur. An example:

<c:import url="WEB-INF/xml/content.xml" var="xfile" />
<c:import url="WEB-INF/xml/language.xsl" var="langsheet" />
<c:import url="WEB-INF/xml/section.xsl" var="sectsheet" />

<x:transform doc="${xfile}" xslt="${langsheet}" var="langfiltered">
      <x:param name="language" value="${language}" />
</x:transform>

<x:transform doc="${langfiltered}" xslt="${sectsheet}">
      <x:param name="sect" value="${sect}" />
</x:transform>

The langsheet filters tags with a special language ID (<tag id="en">...</tag>)
The sect sheet transforms a section of the xml file to HTML

this works fine, but:

PROBLEM
-----------
I have to rewrite this application for an older webserver. It doesn't support the Servlet 2.4, JSP 2.0 and JSTL 1.1 specs. I have to use the older JSTL 1.0, but this doesn't work :(
Notice the transform xml instead of transform doc, due to other specs...

??? CAN'T YOU DO MULTIPLE XSLT TRANSFORMATIONS WITH JSTL 1.0 ???

<c:import url="WEB-INF/xml/content.xml" var="xfile" />
<c:import url="WEB-INF/xml/language.xsl" var="langsheet" />
<c:import url="WEB-INF/xml/section.xsl" var="sectsheet" />

<x:transform xml="${xfile}" xslt="${langsheet}" var="langfiltered">
      <x:param name="language" value="${language}" />
</x:transform>

<x:transform xml="${langfiltered}" xslt="${sectsheet}">
      <x:param name="sect" value="${sect}" />
</x:transform>

The first transformation occurs (language) but the second won't do... It displays all the text (in the specified language) in my html page.

Any ideas?
0
Comment
Question by:Mr_It
  • 3
  • 2
5 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 11760994
Does:

<x:transform xml="${xfile}" xslt="${langsheet}" var="langfiltered" scope="request">

help?

If not, I don't know :-(  Sorry...

Tim
0
 
LVL 35

Accepted Solution

by:
TimYates earned 500 total points
ID: 11761003
Oooh, or try:

<x:transform xml="${xfile}" xslt="${langsheet}" result="langfiltered" scope="request">
0
 
LVL 4

Author Comment

by:Mr_It
ID: 11761811
No that doesn't work either.

I already found another solution. I make use of the apache 'xtags' taglib. Like this:

<%@ taglib prefix="xtags" uri="http://jakarta.apache.org/taglibs/xtags-1.0" %>

<xtags:style xsl="WEB-INF/xml/section.xsl" outputMethod="html" >
      <xtags:param name="sect" value="sect" />
      <xtags:style xsl="WEB-INF/xml/language.xsl" outputMethod="xml">
            <xtags:param name="lang" value="en" />
      </xtags:style>
</xtags:style>

Thanx anyway :)
0
 
LVL 4

Author Comment

by:Mr_It
ID: 11761854
As you were the first and only one to reply, you get the 500 points anyway :)
Thank you, Mr_It!
0
 
LVL 35

Expert Comment

by:TimYates
ID: 11761874
Yay!  I'm glad you got this sorted out!  Sorry I couldn't be of more help!

Thanks for the points :-)

Good luck with it!!

Tim
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now