I want to create a JSP using XSLT tags and <x:transform> . But I donโt have an XML file in my file system and I canโt import it like: <c:import url="./xml/MyXml.xml" var="xmldoc"/> . It is generated dynamically in Java code and is set as the String attribute for the request. I am trying to do it like this:
<div id="mydiv"> <c:set var="xmldoc"> <c:out value="${requestScope.someXmlString}"/> </c:set> <c:import url="./xsl/MyStylesheet.xsl" var="xsltdoc"/> <x:transform xml="${xmldoc}" xslt="${xsltdoc}"/> </div>
or
<div id="mydiv"> <c:set var="xmldoc" value="${requestScope.someXmlString}"> <c:import url="./xsl/MyStylesheet.xsl" var="xsltdoc"/> <x:transform xml="${xmldoc}" xslt="${xsltdoc}"/> </div>
But it does not work. It seems that <x:transform> expects only an XML document (not a string). How can I do it? Or is there another way to do this?
source share