Subject: Re: XSLT Scripting?
From: Eric van der Vlist <vdv@xxxxxxxxxxxx>
Date: Fri, 08 Oct 1999 21:06:05 +0200
|
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
|