xsl-list
[Top] [All Lists]

Re: Remove text Up to Full Stop

2005-08-22 03:10:05

I have also noticed the hex - I use oxygen and it seems to put in this hex 
in the strangest of places. 

I think it's a microsoft-encoded left quote, whgich is OK if you declare
a microsoft encoding in your xml (and xsl) files, and your parser knows
that encoding. But it's not a lot of point posting fragments of xml
using that as if anyone tries to parse that using the default utf8
encoding tehy just get told the file is not well formed as hex 85 isn't
a legal utf8 encoding of anything.

There are plenty of replace templates in the faq, something like

<xsl:template name="x">
 <xsl:param name="x" select="extract"/>
  <xsl:if test="contains($x,'.')">
  <xsl:value-of select="substring-before($x,'.')"/>
  <xsl:text>.</xsl:text>
  <xsl:call-template name="x">
   <xsl:with-param name="x" select="substring-after($x,'.')"/>
  </xsl:call-template>
 </xsl:if>
</xsl:template>

That discards everything after the the last . (and the whole thing if
there isn't a ., so you just need to call that if there is a . in
extract. (untested)

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>