Johnson, Chris wrote:

I guess what I really want is an answer as to why document() isn't
working as it seems it should.


Mostly, I think the unexpected behavior has to do with the standard implementations masking of underlying absolute paths to be relative to the webapplication instead of the filesystem. For example, if your webapp was installed in /usr/share/tomcat4/webapps/blaa

/foo/bar actually maps to /usr/share/tomcat4/webapps/blaa/foo/bar.

Besides, I'm already doing a transform on one document, so I don't
understand how doing this second transform on this other "document"
(servlet call) would be able to be used in the first transform. That's
why I was using document(), so I could read in another xml doc while
doing a transform. I'm using the 2nd doc to do some conditional stuff
in the first transform.


I do it now, but I'm working on tomcat4.1 and jstl 1.1

But since I had nowhere to go but up, I did part of what Kris said. I
tried doing an import of the doc, which worked, but I put the output
(after parsing) into an x:param associated with the original (only)
transform. But that doesn't seem to work.


It wouldn't really because most transformers use a different object tree than DOM which the x:parse is producing.

If I do a 2nd transform on the 2nd doc, how do I reference that in the
first transform?


Did you try adding the xlstSystemId? this sets the systemId of the xslt and allows the document function to do relative resolution from the systemId, thats just straight xslt spec/JAXP behavior. I'm using it in jstl 1.1 because of this very issue.


What version of JSTL/standard.jar are you working with, which version of Tomcat?


-----Original Message-----
From: Mark R. Diggory [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 07, 2004 12:04 PM
To: Tag Libraries Users List
Subject: Re: XSLT question



Try setting the systemId for the stylesheet, this may help configure the


proper resolution.

           <c:import var="xslt" scope="request" url='${url}'/>
           <x:transform xml="${xml}" xslt="${xslt}"
xsltSystemId="${url}"> -Mark

Kris Schneider wrote:



As an alternative, perhaps you can use an XSLT parameter to hold the servlet
output:


<c:import url="/xmlServlet" var="servletXml"/>
<x:parse xml="${servletXml}" var="servletDoc"/>
<x:transform xml="${xml}" xslt="${xslt}">
  <x:param name="dynamicXml" value="${servletDoc}"/> </x:transform>

Where your stylesheet would include an <xsl:param> element:

<xsl:param name="dynamicXml"/>

Haven't tried this with a full-blown document as a parameter before...

Quoting "Johnson, Chris" <[EMAIL PROTECTED]>:





I'm having trouble using the XSLT document() function.

What I need to do is to call a servlet which will send back some dynamic xml that I need to reference in my XSLT template.

I've tried using various relative paths, and the full (http://...) path with no luck. When I use the full path, I get this error in the catalina.out file: Can not load requested doc: Server returned HTTP response code: 500 for
URL: http:... I've made sure there are no typos in the url.


When using a relative path, the error suggests that document() is looking for the resource as a file on the server.

I've looked around on the web and see people supposedly using document() with full paths, but nothing describing the problem I'm having.

Any help would be greatly appreciated.

Thanks,
Chris











--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to