Solved

multiple XSLT transformations with JSTL 1.0

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

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven example error 3 81
arguments to jar 5 44
What kind of framework must i use to do that ? 2 47
Drop down list show all elements but disabled for selection 6 60
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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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.
Suggested Courses

739 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