On 06/14/2011 04:46 PM, Glenn Adams wrote:
You know, given the time spent answering questions about XSL and the XML+XSL -> XSL-FO front-end ("convenience mechanism") in FOP, I sometimes wonder if it would be better to rip out that function. Perhaps then folks would understand better that FOP is fundamentally an XSL-FO -> output format processor.As to the original comment, I agree with Eric that is is not appropriate to consider an FOP extension to accommodate semantics that apply to the XML+XSL -> XSL-FO 'convenience mapping' mechanism.
On the other hand, XSLT is not the best language for implementing wiki syntax rendering either.
An alternative to writing a FOP extension would be to write an XSLT/XPath extension that handles the wiki syntax; instead of simply copying the textual content of the source element, do something like: <xsl:value-of select="wiki:render(.)"/>.
http://xml.apache.org/xalan-j/xpath_apis.html#functionresolver explains a bit what's needed to write a custom XPath function. You could use an existing Java library for wiki syntax rendering, such as http://rendering.xwiki.org/
G. On Tue, Jun 14, 2011 at 8:29 AM, Eric Douglas <[email protected] <mailto:[email protected]>> wrote: It could handle any format you want to write your input in as long as it can be translated to FO. If another format is commonly used for generating FOP input someone would just have to write an input translator extension. FOP doesn't even do anything with XML/XSL. It accepts input as XML/XSL as a courtesy extension. I wrote a transform with embedded code starting with data in XML using an XSL to translate it. Then I figured out how to generate FO and split that out as a separate step. That uses the javax transformer. That step doesn't use any FOP objects. If you think about it, output could be considered extensions also. The main task of the FOP is to input FO and generate the IF. Once that's laid out it can take various renderers and generate output so you have a PDF extension, a PNG extension, a TIFF extension, etc. They don't need to be in the FOP package. Someone who only wants to create PDFs doesn't need any classes which create PNGs. If you could break all the extensions out into subprojects it would make it a few extra steps to download but it would be simplified into smaller jars which of course load faster if you don't need them all. -----Original Message----- From: Christopher R. Maden [mailto:[email protected] <mailto:[email protected]>] Sent: Tuesday, June 14, 2011 9:44 AM To: [email protected] <mailto:[email protected]> Subject: Re: FOP Extension to handle Wiki Syntax On 06/14/2011 07:25 AM, kalgon wrote: > Yes I could transform the XML prior to rendering it to PDF but that > wouldn't be as nice and clean as an extension which would take care of > everything. Moreover, an extension can be reused whereas > pre-transforming the XML would require a specific XSLT for each XML > schema... definitely not the way I want to go. Except that's how XSL works, and what FOP implements. FOP takes exactly[*] 1 kind of input: the FO markup in XML defined by the XSL Recommendations. Nearly all FOP users, as well as users of other XSL formatters, transform their source either with XSLT or some other tool into FO for presentation to the formatter. If FOP supports MediaWiki syntax natively, why not MoinMoin or some other wiki? Why not HTML, DocBook, DITA, CALS, ...? ~Chris [*] approximately
-- Sergiu Dumitriu http://purl.org/net/sergiu/ --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
