this article demonstrates how we can integrate xsl-fo, xslt, and javamail into our existing web-based applications. i show you how we can generate pdf reports for an application through the use of xslt and xsl-fo embedded within the java application. i also illustrate how the generated pdf file can be sent as an e-mail attachment using javamail.
although a variety of web-based technologies such as servlets or web services are available, i chose the jsp approach. a simple jsp-based test harness was written to demonstrate the integration of all these technologies. an html table report generation example is also included to show how the xsl-fo table elements correspond to the html table elements. although using xsl-fo and xslt may be overkill, the greater degree of formatting control and flexibility may prove advantageous.
tools used
xsl-fo is part of the extensible stylesheet language (xsl) family of recommendations from the w3c. xsl is used to define xml document transformations and presentations and is made up of: xslt/xpath xsl-fo xslt is a language for transforming xml documents (mainly from xml to xml or xml to html).xpath allows you to identify specific parts of your xml document and to write expressions to refer to, for example, the nth child element of the specified xml file. it is used extensively by xslt for referencing specified elements within the input document for further processing.
xsl-fo is an xml language that defines page formatting and... 下一页