[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSLT Scripting?
No need for scripting to accomplish this particular example, you can do: <xsl:template match="TELEPHONE"> <AREACODE><xsl:value-of select="substring(.,1,3)"/></AREACODE> <PREFIX><xsl:value-of select="substring(.,5,3)"/></PREFIX> <NUMBER><xsl:value-of select="substring(.,9,4)"/></NUMBER> </xsl:template> Where the "." dot represents the current element, TELEPHONE inside the template. ________________________________________________________ Steve Muench, BC4J Development Team & XML Evangelist http://technet.oracle.com/tech/java http://technet.oracle.com/tech/xml ----- Original Message ----- From: Phil Thomas <pthomas@xxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxx> Sent: Friday, October 08, 1999 10:11 AM Subject: XSLT Scripting? | 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 | 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
|