James Mason wrote on 17/11/04 11:50 AM:
On Wed, 2004-11-17 at 08:54 -0500, Tim Frank wrote:

One thing I don't think JXTemplate can handle (not sure on this) is
outputting non-marked-up content. This would be a problem with CSS
files, for example. I love the way the CSS theme is handled with the
example application (I've copied the idea into another system I'm
working on), so it would be a shame to lose that.

You can output non XML content from JX templates, just as long as your JX Template is a valid XML document. Same way you can output a comma-delimited data file from an XSLT transformation. So outputting CSS, Javascript, etc would not be a technical problem, but it might be ugly to do so.


How would you do this? For the template to be valid xml there needs to
be a root tag, and I haven't seen anyway to keep the tag out of the
results. Is there a <jx:ignore-me> tag or something?


Well, if we are sticking within the Cocoon framework where JX Templates work it is quite easy. This template:


<?xml version="1.0" ?>
<jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0";>
This is my JX Template
</jx:template>

Combined with this sitemap entry:

<map:match pattern="mytest.jx">
  <map:generate type="jx" src="mytest.jx" />
  <map:serialize type="text"/>
</map:match>

Will output nothing more than a simple text file. No root tag required. If you are serializing your JX to XML, of course you need at least a root tag. For CSS/Javascript they DO have a "root" tag of <style> or <script> which you could use and then serialise to XML. The text between the root is always valid.

Sorry this is a little off topic for slide per-se.

Tim

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to