|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.lotus.xsl.server.ApplyXSL | +--com.lotus.xsl.server.DefaultApplyXSL
DefaultApplyXSL extends the ApplyXSL abstract class. It's primary function is to provide a baseline servlet to let you apply XSL stylesheets to XML data at the server. Why do you want to apply XSL stylesheets to XML data at the server? Because you can maximize the sharability of your data without regard to the XML/XSL processing capabilities of your clients.
Attempts will be made to create an XML document DOM from the following sources:
URL=
parameter. This capability
is intended for clients wishing to selectively process XML data at the server. For
security reasons, this URL will be forced to the local IP host.Attempts will be made to create an XSL stylesheet DOM from the following sources:
xslURL=
parameter. This capability
is intended for clients wishing to selectively override the server algorithm for applying XSL
stylesheets. For security reasons, this URL will be forced to the local IP host.This servlet requires the following software:
If you are running WebSphere Application Server v2.03 or later, this servlet is already installed. Otherwise, install this servlet by:
Default Apply XSL Servlet Base Configuration | ||||
Parm Name | Parm Value | Required? | ||
Servlet Name | DefaultApplyXSL | Yes | ||
Description | Apply XSL to XML | No | ||
Servlet Class | com.lotus.xsl.server.DefaultApplyXSL | Yes |
Default Apply XSL Servlet Initialization Properties | ||||
Description | Parm Name | Parm Value | Required? | Default Value |
Location of result-ns/MIME mapping rules file | mimeURL | a full URL or path relative to the System's server.root / servlets directory | No | None |
Location of user-Agent/media mapping rules file | mediaURL | a full URL or path relative to the System's server.root / servlets directory | No | None |
XSL stylesheet URL | xslURL | http://localhost/localpath/yourDefault.xsl | No | None |
Run in debug mode? | debug | true or false | No | true |
Strip whitespace from XML+XSL result | stripWhiteSpace | true or false | No | false |
Generate warning messages from XSL processor | noConflictWarnings | true or false | No | false |
The following examples serve to illustrate the use of this servlet:
The following usage notes may prove...well...useful:
debug=true
HTTP request parameter.http://www.w3.org/TR/REC-html40=text/html...and an XSL stylesheet that contains...
<xsl:stylesheet xmlns:html="http://www.w3.org/TR/REC-html40=text/html" result-ns="html">...will have its HTTP response MIME type set to text/html. If you wish to define XSL stylesheets that transform XML data into a format other than HTML, mapping rules should be added to mime.properties.
MSIE=explorer MSPIE=pocketexplorer...and XML data that contains XSL stylesheet associations of...
<?xml-stylesheet media="explorer" href="alldata.xsl" type="text/xsl"?> <?xml-stylesheet alternate="yes" media="pocketexplorer" href="somedata.xsl" type="text/xsl"?>...and an HTTP request from Microsoft's Pocket Internet Explorer (that contains a user-Agent value of
foo MSPIE bar
) will apply the XSL stylesheet somedata.xsl. If you wish to define
additional browser types, or define relationships that exploit specific presentation capabilities
of browsers, simply define additional mapping rules in media.properties.
Constructor Summary | |
DefaultApplyXSL()
|
Method Summary | |
java.lang.String |
getMedia(com.lotus.xsl.server.HttpServletRequest request)
Returns a media name mapped from the specified request's user-Agent header. |
static java.lang.String |
getXSLURLfromDoc(com.lotus.xsl.server.Document xmlDoc,
java.lang.String attributeName,
java.lang.String attributeValue)
Returns the XSL stylesheet URL associated with the specified XML document. |
void |
init(com.lotus.xsl.server.ServletConfig config)
Initialize operational parameters from the configuration. |
com.lotus.xsl.server.Document |
makeDocument(com.lotus.xsl.server.HttpServletRequest request,
java.io.InputStream ins,
com.lotus.xsl.server.ErrorHandler listener)
Returns a DOM from the specified input stream. |
Methods inherited from class com.lotus.xsl.server.ApplyXSL |
doGet,
getContentType,
process |
Constructor Detail |
public DefaultApplyXSL()
Method Detail |
public void init(com.lotus.xsl.server.ServletConfig config) throws com.lotus.xsl.server.ServletException
config
- Configurationpublic com.lotus.xsl.server.Document makeDocument(com.lotus.xsl.server.HttpServletRequest request, java.io.InputStream ins, com.lotus.xsl.server.ErrorHandler listener) throws java.lang.Exception
request
- Could contain the URL for catalogins
- Input stream to parselistener
- To record detailed parsing messages for a possible return to requestorpublic java.lang.String getMedia(com.lotus.xsl.server.HttpServletRequest request)
Refer to the mime.properties file for details.
request
- Contains the user-Agent header#getStylesheet
public static java.lang.String getXSLURLfromDoc(com.lotus.xsl.server.Document xmlDoc, java.lang.String attributeName, java.lang.String attributeValue)
xmlDoc
- XML Document to be searched for associated XSL stylesheetsattributeName
- Attribute name to provide preferential matchingatrributeValue
- Attribute value to provide preferential matching#getStylesheet
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |