?
Solved

multiple XSLT transformations with JSTL 1.0

Posted on 2004-08-10
5
Medium Priority
?
803 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.

718 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