On Tue, 16 Jul 2002, Hartmut Bernecker wrote:
> I used to take struts-tags for doing some XSL-Transformations:
> <xsl:apply nameXml="myXmlStringInScopeVariable"
> xsl="xsl/myXslTemplates.xsl"/>
>
> Now I want to switch to JSTL and want to do the same:
> <c:set var"xsl"><c:import url="xsl/myXslTemplates.xsl"/></c:set>
> <x:transform xml="${myXmlStringInScopeVariable}" xslt="${xsl}"/>
>
> But the result is:
> javax.servlet.ServletException:
> javax.xml.transform.TransformerConfigurationException:
> javax.xml.transform.TransformerException: org.xml.sax.SAXParseException:
> Dokumentwurzelelement fehlt
>
> ["Dokumentwurzelelement fehlt" means: document root missing]
>
> I would appreciate you giving me a hint: what is wrong, how to do it
> better?
"Document root missing" typically indicates an ill-formed XML document or
-- as is likely here -- a missing one. Try printing the values of
"${xsl}" and "${myXmlStringInScopeVariable}" using <c:out> to ensure that
they really have the values you expect. (Also, as a simplifying step and
a way to eliminate potential errors, you can combine
<c:set><c:import/></c:set> into a single <c:import var="..." />.)
--
Shawn Bayern
"JSTL in Action" http://www.jstlbook.com
(coming in July 2002 from Manning Publications)
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>