Click to See Complete Forum and Search --> : how to get the first sentence or paragraph


lyndalijun
05-24-2007, 01:46 PM
I am new to xml, I need to get first paragraph or first sentence , or first 50 characters from of a description. The descrition actually actually is a full article, I can get the full text by this:
<droplet bean="/atg/dynamo/droplet/xml/NodeMatch">
<param name="node" value="param:element">
<param name="match" value="description/text()">
<oparam name="output">
<setvalue bean="TempVar.description" value="param:matched.nodeValue">
</oparam>
</droplet>

Note: value="description/text()" is the part to get this descrition full text, because this value is full article, it is too big to use javascript substring to get the first paragraph or sentence, how do I change "description/text()" so that is produce only partial text body (less than 200 words)? Thanks for your help.
Best Regards
Lynda