Solved

multiple XSLT transformations with JSTL 1.0

Posted on 2004-08-10
5
799 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
strDist challenge 35 132
HashMap Vs TreeMap 12 68
Core Java. What output will be and why ? 6 68
java 8 lambda expresssions exception handling 3 106
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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.

679 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