Re: New to CS - Process text between certain tags

"David Jeske" <[email protected]> Fri, 29 May 2009 08:29:18 -0000
Newsgroups gmane.text.clearsilver.general
Message-ID <[email protected]>
Clearsilver contains the ability to register a string handler function, such
that you could do something like this in your templates:

<?cs var:myFormatFunction("my text fragment") ?>

I don't believe this is currently exported to Java, but this would be trivial
to add to the wrapper if it is not. If this will meet your need, and the Java
JNI wrapper is too much for you to tackle, let me know and I can add it. You
can see (probably not so helpful) explanation of the C function here:

http://www.clearsilver.net/docs/c_api.hdf#cs_register_strfunc

If you wish to include html tags and lots of stuff into the string which is
processed, this won't work so well for you, as you won't want to try to jam
that into a quoted ("") string literal. If this is the case, let us know, and
provide an example of what you're trying to do specifically and we can offer
some suggestions.

-- stuffedlambmeat wrote:
> I am new to CS, and have a quick question. I want to add a special tag in my
> templates for certain pieces of text. For example, I want to enclose text in
> tags like <special> and </special>. Then, I want to do special processing on
> these pieces of text when it comes to rendering this text. This processing
will
> be happening in Java, before the page is rendered. Any pointers on how to
> achieve this?