Altova Mailing List Archives

Re: [xsl] How to expand a string

From: David Carlisle <davidc@--------->
Date: 8/30/2006 11:20:00 AM
> but I am stuck in the 1.0 world;

<xsl:stylesheet version="1.0" xmlns:xsl="">
<xsl:template match="w">
was: <xsl:value-of select="."/>
now: <xsl:call-template name="decamel"/> 

<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:value-of select="$a"/>
  <xsl:if test="string-length($s)&gt;1">
    <xsl:call-template name="decamel">
      <xsl:with-param name="s" select="substring($s,2)"/>


$ 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)



These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.