OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   XML friendly runtime templating languages

[ Lists Home | Date Index | Thread Index ]
  • To: XML Developers List <xml-dev@lists.xml.org>
  • Subject: XML friendly runtime templating languages
  • From: Robert Koberg <rob@koberg.com>
  • Date: Mon, 28 Mar 2005 17:37:32 -0800
  • User-agent: Mozilla Thunderbird 1.0 (Macintosh/20041206)

Hi,

I recently did an app that pre-generated out to Jakarta Velocity 
templates. I chose Velocity because I thought it was the most XML 
friendly (and I have a java bias). I posted a minor annoyance about 
still having to do some redundant coding for SGML attribute minimazation 
brought into XML:

#set ($isChecked = $page.getBoolean("isChecked"))
#if ($isChecked)
   <input ... checked="checked"/>
#else
   <input .../>
#end

I can't write something like:

<input ... #if($isChecked)checked="checked"#end/>

becuase the template code must exist in a well formed XML document to be 
used in an XSL transformation.

Andrew Clover clued me in to PXTL where (from the PXTL spec):

"If it is a conditional element, it is checked for success. If 
unsuccessful, the element is removed with all its child nodes. If 
successful, the element is replaced by its children."

Andrew responded to my post with:

"Well that's a failing of the templating language rather than XHTML as 
such. A templating language that aims at being helpful for XML should 
provide a mechanism for inclusion/exclusion of an attribute.

For example in PXTL:

   <input type="radio" checked="checked{?px_if isChecked?}"/>

*I was wondering if there are other runtime templating languages out 
there that I am missing.* I am not including XSLT for runtime processing 
because of its need to parse the XML source for each transformation.

best,
-Rob




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS