tag extension to get XSL formatting inside JSP pages?

Subject: tag extension to get XSL formatting inside JSP pages?
From: "miles thompson" <miles@xxxxxxxx>
Date: Wed, 29 Mar 2000 12:13:32 +1200
Hiya, 

I dont know much about how XSL/Saxon works so I
wonder if  this is even possible ?

problem: 

 - we are gonna be using JSP's for general site pages.
 - I'd like to incorporate XSL/XML as a way to format 
    certain little pieces of specialised "content" into  HTML chunks
   (  which will be placed inside the page at appropriate places )

question:
  
 - whats a good way to integrate these two approaches? Has
   anybody had experience with this ?

 possible answer:

 I was thinking along the lines of extending SAXON
 by defining a JSP tag extension that reads in the XSL
from the page, grabs the XML from some external source
and outputs the formatted HTML back where the tag extension
was...

That is, sortof  like the following...

  welcome.jsp:

<%@ page import="com.icl.saxon.*" %><%@ page errorPage="error.jsp" %>
<%
  //...  various bits of database connection / datagrabbing etc etc..
%>
<HTML>
<HEAD>
</HEAD>
<BODY>

<SPECIAL_JSP_TAGEXTENSION xmlsource="<% choose a file source here..%>
<xls:template match="myFrag">
    ... xsl transformation conversion stuff.. yadda yadda yadda
</xsl:template>
</SPECIAL_JSP_TAGEXTENSION>

<% do some other stuff %>
<other html>
<SPECIAL_JSP_TAGEXTENSION xmlsource="<% choose a different source .%>
 .. another fragment... 
</SPECIAL_JSP_TAGEXTENSION>

</BODY>
</HTML>

---

So. The question is.. Is this even possible or am I missing some basic
understanding ?

And if it is possible..  
 - Has anyone done something like this already?
 - Any guesses on how this approach might work performance-wize?

It would be really cool, because then we could have the JSP page contain
just the XSL, and <%%> scripting stuff that is wanted for presentation
and have the business logic inside our java beans.

 Thanks heaps in advance for any suggestions ..
 
---

Miles Thompson
miles@xxxxxxxxxxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread