[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Remove text Up to Full Stop

Subject: Remove text Up to Full Stop
From: "James Game" <james_game2002@xxxxxxxxxxxxx>
Date: Mon, 22 Aug 2005 08:58:13 +0000
full stop games
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.