Posted By:
Taruvai_Subramaniam
Posted On:
Friday, May 24, 2002 11:26 AM
We have been creating a javax.xml.transform.dom.DOMSource object and attaching it to HTTPRequest. Then we use a javax.xml.transform.Templates.newTransformer to create a compiled style sheet so that we can efficiently re-use it across many requests. We then use a filter with a javax.xml.transform.Transform to transform the source. Now we want to do it using the x tags in JSTL. Here is the problem. In x:transform source I can use a javax.xml.transform.dom.Source in the source attribute. But for the xslt attribute I can only use javax.xml.transform.Source and there appears to be no way to go from javax.xml.transform.Transformer to a javax.xml.transform.Source. I can of course use a x:transform to re-use the transform but that's per page whereas I want to
More>>
We have been creating a javax.xml.transform.dom.DOMSource object and attaching it to HTTPRequest. Then we use a javax.xml.transform.Templates.newTransformer to create a compiled style sheet so that we can efficiently re-use it across many requests. We then use a filter with a javax.xml.transform.Transform to transform the source.
Now we want to do it using the x tags in JSTL. Here is the problem. In x:transform source I can use a javax.xml.transform.dom.Source in the source attribute. But for the xslt attribute I can only use javax.xml.transform.Source and there appears to be no way to go from javax.xml.transform.Transformer to a javax.xml.transform.Source. I can of course use a x:transform to re-use the transform but that's per page whereas I want to re-use the transformation across requests.
Is my only option to parse the xslt style sheet into a Source object, store it in application scope and then pass it as the xslt attribute to the x;transform tag?
<<Less