[xsl] Remove text Up to Full Stop

Subject: [xsl] Remove text Up to Full Stop
From: "James Game" <james_game2002@xxxxxxxxxxxxx>
Date: Mon, 22 Aug 2005 08:58:13 +0000
Hi,

I have the following xml:

</article>
- <article id="_375236674">
<url>http://***************************</url>
<headline_text>UK's Blair urged to push UN anti-genocide plan</headline_text>
<source>Reuters South Africa</source>
<media_type>text</media_type>
<cluster>moreover...</cluster>
<tagline />
<document_url>http://za.today.reuters.com</document_url>
<harvest_time>Aug 22 2005 8:09AM</harvest_time>
<access_registration />
<access_status />
<extract>LONDON (Reuters) - Britain's Tony Blair must pressure the United States and other doubters to back a United Nations plan to stop genocides like the 1994 slaughter in Rwanda from happening again, aid organisation Oxfam said on Monday. Britain's prime</extract>
<valid_time>Aug 29 2005 8:09AM</valid_time>
</article>



And the following xsl:


DATAPACKET Version="2.0">
           <xsl:call-template name="CDSMetaData"/>
           <ROWDATA>

               <xsl:for-each select="//**">
                   <xsl:apply-templates select="article"/>
               </xsl:for-each>
           </ROWDATA>
       </DATAPACKET>

</xsl:template>

<!-- Structure of the clientdataset is defined as: -->
<xsl:template name="CDSMetaData">
<METADATA>
<FIELDS>
<FIELD attrname="id" fieldtype="string" WIDTH="20"/>
<FIELD attrname="headline_text" fieldtype="string" WIDTH="255"/>
<FIELD attrname="extract" fieldtype="string" WIDTH="255" />


           </FIELDS>
       </METADATA>

</xsl:template>

<xsl:template match="article">

       <xsl:variable name="id" select="@id"/>
       <xsl:variable name="headline_text" select="headline_text"/>
       <xsl:variable name="extract" select="extract"/>


<xsl:if test="$headline_text and $extract">
<xsl:if test="$headline_text!='' and $extract!='' and $extract!='Article not found' and $extract!='extract unavailable'">
<ROW id="{$id}"
headline_text ="{$headline_text}"
extract ="{$extract}" />
</xsl:if>
</xsl:if>
</xsl:template>



</xsl:stylesheet>



The only part i cant figure out on this is how to remove all text (and whitespace) after the last full stop. Obviously this is not always in the same place. Any help you can offer is much appreciated as i am fairly new to xsl.


Many Thanks,
James

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger 7.0 today! http://messenger.msn.co.uk


Current Thread