Can radiant tags replace simple XSLT?

Can radiant tags replace simple XSLT? For example, how would I create a
tag that wrapped n tags?

Yes and no. There are many available tags for manipulating content,
but they primarily manipulate existing content in the CMS, i.e. pages,
page-parts, snippets, and layouts. Can you give an example of the
source you want to transform and the result of its transformation?

Of course, there is always the possibility for a custom extension that
processes XML and XSLT using libxml2/libexslt. That would be kind of
neat, in fact.


I am trying to avoid XSLT if possible, I would like to leave XSLT behind

For a simple example, let us say a page contained the following radiant

And I wanted it to generate the following html:

xxx xxx

Can custom radiant tags be constructed to do this?

Personally, I agree with Martin F. on this matter. See

Unless speed is critical I will simplicity whenever possible.

just curious: isn’t XSLT faster than any radiant template parser?
XSLT is bad only in one thing - when it goes to dynamic data,
you can’t change input XML on fly but XSLT parser is really good idea
for template language.

Hi Dave,

If you want to get away from XSLT but still want to keep this XML
you could always make an extension that defines a filter and keep your
data in a separate page part (so that the filter is only applied to that
data). There’s an example filter in the trunk:

and another extension that adds a filter on the 3rd party extension page
(Maruku Filter I think?).

In your filter class, you would define a “filter(text)” method that
the input text and outputs your final html. So in that method you could
over the XML with REXML or Hpricot (or any other library) and handle the

Or the filter could run an XSLT transformation if one were so inclined.



I agree with the other responses, but here’s a sample of what you
might be able to do:

<r:column />
<r:column />

tag ‘table’ do |tag|
returning do |output|
output << “

output << “” << tag.expand << “”
output << “


tag ‘table:column’ do |tag|

\n xxx\n”

Obviously that’s very rough and just an outline of what you might want
to do. If your end users are HTML/CSS proficient, then just use HTML!
Radiant is nice in that it gets out of your way in terms of design.

When you need something programmatic, then consider using Radius tags.


Thanks, there is no doubt in my mind that Haml is impressive! If I was
only person involved I suspect that I would prefer that route.

However, I have to deal with people who only talk html and css.
the simplest solution is to embed radiant tags into the html (if I can
them to do the job).

I actually haven’t tried HAML and SASS yet either – the reason I linked
the SassFilter was that it’s an example of an extension that implements
I may not be understanding your use-case correctly, but who or what is
producing this XML? And why could they/it just use standard HTML

I guess no matter what you could use either the filter or radius tag
solution depending on what fits your situation best.