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

Re: XSLT Scripting?

Subject: Re: XSLT Scripting?
From: Eric van der Vlist <vdv@xxxxxxxxxxxx>
Date: Fri, 08 Oct 1999 21:06:05 +0200
Re: XSLT Scripting?
Hi Phil,

Try this :

-----------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">

<xsl:template match="TELEPHONE">

	<AREACODE><xsl:value-of select="substring-before(string(),
'-')"/></AREACODE>
	<PREFIX><xsl:value-of
select="substring-before(substring-after(string(), '-'),
'-')"/></PREFIX>
	<NUMBER><xsl:value-of select="substring-after(substring-after(string(),
'-'), '-')"/></NUMBER>

</xsl:template>
</xsl:stylesheet>
-----------

These functions are documented in the XPATH recommendation
(http://www.w3.org/TR/xpath).

Hope this helps.

Eric

Phil Thomas wrote:
> 
> I'm new to XSL and this list.  I have been looking through the XSL and
> XSLT Recommendations and I was wondering if there was any built-in or
> extensibility mechanism for scripting?
> 
> For example:
> 
> If I have an XML document containing the following tag:
> 
> <TELEPHONE>316-855-2145</TELEPHONE>
> 
> I would like to transform the above tag into the following 3 tags:
> 
> <AREACODE>316</AREACODE>
> <PREFIX>855</PREFIX>
> <NUMBER>2145</NUMBER>
> 
> Does anyone know if there currently any way to do this type of
> conversion, or will it be addressed in the future?
> 
> Any help would be greatly appreciated.
> 
> --
> 
> Phil Thomas
> Systems Engineer
> TouchNet Information Systems, Inc.
> phone: (913)599-6699
> email: pthomas@xxxxxxxxxxxx
> web: http://www.touchnet.com
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

-- 
------------------------------------------------------------------------
Eric van der Vlist                                              Dyomedea

http://www.dyomedea.com                          http://www.ducotede.com
------------------------------------------------------------------------


 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.