Re: New to CS - Process text between certain tags

Brandon Long <[email protected]> Fri, 29 May 2009 12:03:44 -0700
Newsgroups gmane.text.clearsilver.general
Organization Fiction L Networks
Message-ID <20090529190344.GA24672@bl1>
Its a bit more challenging than you might think, but not too bad.

In any case, I'm not sure if that's what he's asking for.  If you're
asking about post-processing the results of the render, of course that's
possible as well.  In that case, you just render to a Java String, and
then you can find the <special> tags and manipulate the text however you
want.

Brandon

On 05/29/09 David Jeske uttered the following other thing:
> 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?
> 
> 
> ------------------------------------
> 
> Yahoo! Groups Links
> 
> 
> 
-- 
 "Some people never observe anything. Life just happens to them. They
  get by on little more than a kind of dumb persistence, and they
  resist with anger and resentment anything that might lift them out of
  that false serenity." -- Frank Herbert, _Heretics of Dune_