grenoml wrote:
I thought that maybe there was a problem with JSTL
1.0.1 so I downloaded 1.0.2 and copied the jars to
/WEB-INF/lib of my webapp but the same problem still
occurs:

SCENARIO:
I am trying to use the <x:transform> tag to write
the resulting transformed document to a session
variable. So my tags look like this:

CODE:
<c:import url="file:///D|/Documents and
Settings/greno/Downloads/XSLT/xt-20020426a-src/demo/server/mylistings.xml"
var="xml"/>
<c:import url="file:///D|/Documents and
Settings/greno/Downloads/XSLT/xt-20020426a-src/demo/server/mylistings.xsl"
var="xslt"/>

<x:transform xml="${xml}" xslt="${xslt}" var="doc"
scope="session" /> <c:out value="Here is result just after
transform:${doc}" />

RESULT:
This is what I see in the browser:
====================================================
Here is result just after transform:[#document: null] ====================================================
(I have dumped the session variables and sure enough
the variable 'doc' contains '#document: null'.) And if
I do <x:out select="${doc}/"/> I receive an XPath null
exception.

NOTE:
If I don't use the var/scope then the document is
output to the page and I appears in the browser
perfectly.

QUESTIONS:
What do I have to do to get this to work? Has
anyone got this working?
The result of a transformation that the <x:transform> action stores
in the variable is DOM tree (org.w3c.dom.Document), and converting
it to a String gives the result you see. You should only use the
"var" attribute if you want to further manipulate (e.g. parse or
transform) the transformation result.

To save the String representation of the transformation, you can use
the <c:set> action like this instead:

  <c:set var="doc" scope="session">
    <x:transform xml="${xml}" xslt="${xslt}" />
  </c:set>
  <c:out value="Here is result just after transform:${doc}" />

Hans
--
Hans Bergsten		[EMAIL PROTECTED]
Gefion Software		http://www.gefionsoftware.com
JavaServer Pages	http://TheJSPBook.com


--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@;jakarta.apache.org>

Reply via email to