|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to expand a string
> but I am stuck in the 1.0 world; <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="w"> was: <xsl:value-of select="."/> now: <xsl:call-template name="decamel"/> </xsl:template> <xsl:template name="decamel"> <xsl:param name="s" select="."/> <xsl:variable name="a" select="substring($s,1,1)"/> <xsl:if test="not(translate($a,'QWERTYUIOPASDFGHJKLZXCVBNM',''))"> <xsl:text> </xsl:text> </xsl:if> <xsl:value-of select="$a"/> <xsl:if test="string-length($s)>1"> <xsl:call-template name="decamel"> <xsl:with-param name="s" select="substring($s,2)"/> </xsl:call-template> </xsl:if> </xsl:template> </xsl:stylesheet> <x> <w>FailedCriteria</w> <w>NoSampleDetected</w> <w>OutsideOfCalibrationRange</w> <w>DetectorOverRange</w> </x> $ saxon camel.xml camel.xsl <?xml version="1.0" encoding="utf-8"?> was: FailedCriteria now: Failed Criteria was: NoSampleDetected now: No Sample Detected was: OutsideOfCalibrationRange now: Outside Of Calibration Range was: DetectorOverRange now: Detector Over Range (with a bit of extra work you could avoid putting a space in front of leading capitals as well) David
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
Winners and finalists announced at SOA World Conference in November. 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
|







