com.lotus.xsl.server
Class ApplyXSL

com.lotus.xsl.server.ApplyXSL
Direct Known Subclasses:
DefaultApplyXSL

public abstract class ApplyXSL

ApplyXSL is an abstract class that can be extended to supply the basic functions for transforming XML data using XSL stylesheets.


Constructor Summary
ApplyXSL()
           
 
Method Summary
 void doGet(com.lotus.xsl.server.HttpServletRequest request, com.lotus.xsl.server.HttpServletResponse response)
          HTTP Get method passed on to process.
 java.lang.String getContentType(com.lotus.xsl.server.Document xslDoc)
          Returns the response MIME type using the result-ns (result namespace) attribute of the stylesheet to be applied and result-ns to MIME mapping table.
 void init(com.lotus.xsl.server.ServletConfig config)
          Initialize operational parameters from the configuration.
 void process(com.lotus.xsl.server.HttpServletRequest request, com.lotus.xsl.server.HttpServletResponse response)
          Coordinates applying an XSL stylesheet to XML data using operational parameters.
 

Constructor Detail

ApplyXSL

public ApplyXSL()
Method Detail

init

public void init(com.lotus.xsl.server.ServletConfig config)
          throws com.lotus.xsl.server.ServletException
Initialize operational parameters from the configuration.
Parameters:
config - Configuration
Throws:
com.lotus.xsl.server.ServletException - Never thrown

getContentType

public java.lang.String getContentType(com.lotus.xsl.server.Document xslDoc)
Returns the response MIME type using the result-ns (result namespace) attribute of the stylesheet to be applied and result-ns to MIME mapping table. If a mapping can not be performed, the response MIME type will be set to text/xml.
Parameters:
xslDoc - XSL document DOM which hopefully contains a result-ns attribute on an xsl-stylesheet element.
Returns:
The response MIME type to be set
See Also:
#ourResultToMimeProps, process(com.lotus.xsl.server.HttpServletRequest, com.lotus.xsl.server.HttpServletResponse)

doGet

public void doGet(com.lotus.xsl.server.HttpServletRequest request,
                  com.lotus.xsl.server.HttpServletResponse response)
           throws com.lotus.xsl.server.ServletException,
                  java.io.IOException
HTTP Get method passed on to process.
Parameters:
request - The request
response - The response
Throws:
com.lotus.xsl.server.ServletException - Never thrown
java.io.IOException - Never thrown
See Also:
process(com.lotus.xsl.server.HttpServletRequest, com.lotus.xsl.server.HttpServletResponse)

process

public void process(com.lotus.xsl.server.HttpServletRequest request,
                    com.lotus.xsl.server.HttpServletResponse response)
             throws com.lotus.xsl.server.ServletException,
                    java.io.IOException
Coordinates applying an XSL stylesheet to XML data using operational parameters.

If successfully applied, the result tree will be streamed to the response object and the content type set according to the XSL stylesheet's result-ns attribute.

If there is a problem in parsing the XML/XSL or if there is a problem in applying the XSL to the XML, an exception will be streamed to the response object. The detail of the information returned in the response object will depend on whether we're running in debug mode or not.

Parameters:
request - May contain information relevant to creating XML and XSL document DOMs
response - Where to write the transformation result
Throws:
com.lotus.xsl.server.ServletException - Never thrown
java.io.IOException - Never thrown
See Also:
#getDocument, #getStylesheet, getContentType(com.lotus.xsl.server.Document), #displayException