Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

multiple XSLT transformations with JSTL 1.0

Posted on 2004-08-10
5
Medium Priority
?
804 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 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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…
A solution for Fortify Path Manipulation.
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.

963 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