|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Matching on Commas and Full Stops
Hi again all
When formating the contents of a text node, I want to achieve the sematics of the following regular expression:
s/([,\.])\s*/$1\n/g;
That is, on the occurance of a comma or fullstop, insert a line-feed (replacing any following whitespace). I have attempted (but
failed) to do achieve these semantics in xsl by the following:
<xsl:template match="contactAddress">
<!-- this fails for two reasons: -->
<!-- 1. The comma is an "unexpected token" -->
<!-- 2. The fullstop/period is interpreted as the current node -->
<xsl:if test=",|.">
<xsl:apply-templates/>
<BR></BR>
</xsl:if>
</xsl:template>
<xsl:template match="contactAddress">
<!-- Try and use XML entities -->
<!-- Fails because XT believes these entities are undefined -->
<xsl:if test=", | .">
<BR></BR>
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
Does the answer lie in the functions defined in section 2.6.2 of the current XSL WD. Any ideas?
Thanks in advance
Nigel
--
Nigel Byrnes
"We continue..." Pete Tong
Software Engineering and Applications Group,
Philips Research Labs,
Redhill. Tel: +44 (0)1293 815578
RH1 5HA. Fax: +44 (0)1293 815024
UK. GSM: +44 (0)7899 940391
Email: byrnes@xxxxxxxxxxxxxxxxxxxxxxxx
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








