Hi,
Ok, I agree with you in the point that each approach has its
own advantages or drawbacks.
Most template engines are more capable than they look, and I believe
there are many capable to produce at the same time HTML, .RTF and .PS
content.
I haven't seen two different (not speaking about the same)
hardcoded API libraries capable at the same time to:
- generate one HTML content and one for other type (let
say .PDF)
- use the same interface.
Yes, is difficult to use templates to generate non-textual data,
but also Acrobat, Word or other "binary" formats were designed
to be used in proprietary "wysiwyg" word-processors with little
support for API-based generators. (except mabe for VBScript + OLE
automation - wich I dont know much about)
---------------------------------------------
Despite their drawbacks, templates have two big
advantages:
- maximum flexibility - one can not only change look&feel but also insert
new information(s) from different "objects" (other apps)
than ones already printed, in the same document.
Or add new templates by changing existing ones,
with new views to existing data, without touching the "core"
of the application.
- Keep structure as simple as possible, and automate (hide
from both programer's and designer's eyes)
some tedious tasks that otherwise are annoying to keep track in
programs.
Yes, proprietary, closed loop-tags
or simple $foreach and conditional constructs are required,
but that's all -
don't forget that now most web designers handle well
at least one of interpreted languages like
javascript, perl, php or other - tag-oriented style.
I would use programmed (let say Word) generator only
if my users cant use a similar-feature text based format,
like .rtf
----------------------------------------------
XML debate - I see XML more as a portable way to represent and change
structured data and documents than a replacement for template engines,
with or without XSL.
XSL is good to alter the way one or more XML docs are displayed.
Template engines can do all these now:
- Generate XML content from non-XML internal data.
- Generate within the same "text" document data from one or many
XML-parsed internal java structures.
- Generate XSL based on other application or user specific "options"
to alter how XMLs are shown..
Look at a typical "rich" web interface - it has lots of dynamic
informations from different sources with different semantics:
- Blinking Menu bars on left and/or top side,
- Structured logical content from more than one XML document
(like a list of products within a shop-basket)
- credits & discounts based on user's history, affect displayed data..
- look&feel depending on user prefferences or/and site-wide prefferences
- Advertising banners elsewhere on same window, wich need be refreshed
with different content at each 2 minutes, and have no connection
with current application, but with what user seemed to be interested in,
- an e-mail icon in bottom-left corner, wich animates when new mail
arrives...
Consider this is a screen within an application deployed at many sites,
each with specific customizing requirements, then
add to all these ACL-controlled conditional display for specific
data (show reseller prices too, but only if current user is reseller)
and you'll have a mess, no matter you use templates, hardcoded
java, or XML, specially after customers will want to display many
other data within existing pages, then localise them in many other
languages..
But still, at least for me, templates will handle best such
situations.
90% of the cases users wont stop asking new functionality.
Cezar.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html