You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Smith <je...@centralscheduling.net> on 2003/04/23 19:52:52 UTC

[OT] XSLT errors in JSP - Stream Closed or Root Element Missing - take your pick

Hi Struts-o-philes,

This is probably a bit off topic, but since I'm not entirely sure
where the error is coming from, I'm hoping other Struts with XML users
might be able to shed some light on my problem.

I WAS using XTags to perform an XSLT transform by doing this:
<xtags:style xsl="/WEB-INF/XSL/mytransform.xsl" >
   all my xml is here
</xtags:style>

It worked fine, but every second time I loaded the page, I'd get

    [ServletException in:/Jsps/Tiles/MyDisplay.jsp]
    java.io.IOException: Stream closed'

A simple refresh always results in a clean rendering of the page, but
I have no idea what's causing it.

So, unsure of how to fix that, I thought I'd try using JSTL
instead of XTags. Now I'm doing it this way:
<x:transform xslt="/WEB-INF/XSL/mytransform.xsl" >
    all my xml is still here
</x:transform>

But now I get this error:
    javax.xml.transform.TransformerException:
    org.xml.sax.SAXParseException: Document root element is missing.'

The xsl file has not changed, and I am confident that it is well
formed, functional XSL.

Can anybody offer a hint on solving either problem? I don't really
care which way I invoke my XSL, as long as it works. (I'd even
entertain other ways to invoke the transform.)

Thanks,
Jefficus                        
mailto:jeffs@centralscheduling.net


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org