W3C home > Mailing lists > Public > xproc-dev@w3.org > September 2012

XML to plain text conversion

From: Zearin <zearin@gonk.net>
Date: Wed, 26 Sep 2012 15:18:51 -0400
Message-Id: <26AD0091-A49C-4DC1-9169-FF5D8945DDE8@gonk.net>
To: XProc Dev <xproc-dev@w3.org>
I’m working on a project that’s performs some XML-to-text conversions.  Although the output is “text” (as far as XML processors are concerned), it must still follow a specific structure.  

I’m striving for modular, reusable code.  I’ve split up my XSL into 2 libraries: 

an “API” library, providing a bunch of callable templates and functions; these accept parameters and output text
a “client” library, which makes use of the “API” stylesheets to convert XML serializations of the plain text format back to original form

By this separation, I hope that the first library (of callable things) might be useful in ways I never imagined—rather than limiting it to the specific XML transformation I’m covering in the second library.  I realize this might be unconventional, but I’m convinced it’s the best choice for the project’s future.

However, I have found very few resources about XSL transformation to plain text.  I have some questions…

Are there any guidelines or best practices?  
For the callable items, are named templates or functions preferred?  (Accept parameters, output the text)
As my first XML library, any advice for writing XSL (and XProc) intended for re-use by others?


—Zearin (Tony)
Received on Wednesday, 26 September 2012 19:19:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 26 September 2012 19:19:27 GMT