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

RE: pattern matching in xslt

Subject: RE: pattern matching in xslt
From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx>
Date: Tue, 23 Apr 2002 15:24:36 -0600
xslt pattern match
At 03:01 PM 4/23/2002, you wrote:
Regarding exslt, I don't think I can implement anything but the default
Xalan, IBM XML for Java packages. Thanks just the same!

The stuff at exslt.org are ordinary templates. I assume that Xalan can execute an XSL template.


[time passes]

I just completed your request; here is your XSL stylesheet. You will need to modify the path to reflect Xalan's namespace and (I assume it has this) its node-set extension function. I used MSXSL so you can delete those references.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:str="http://www.exslt.org/str" extension-element-prefixes="msxsl str">
<xsl:import href="strings.xsl" xmlns="http://www.exslt.org/str"/>
<xsl:template match="/">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="description">
<xsl:element name="result">
<xsl:variable name="tokens">
<xsl:call-template name="str:tokenize">
<xsl:with-param name="string" select="."/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="token-node-set" select="msxsl:node-set($tokens)"/>
<xsl:for-each select="$token-node-set/*[. != '..']">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:value-of select="' '"/>
</xsl:if>
</xsl:for-each>
</xsl:element>
</xsl:template>
</xsl:stylesheet>



Greg Faron Integre Technical Publishing Co.



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


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.