Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: string to char conversion

From: "Boris" <shaithan@---.-->
To: NULL
Date: 3/3/2006 2:56:00 AM
Thank for replying so quickly,
I assumed that I need to solve the problem with a recursive algorythm,
my problem is I got no idea for a good stop critea, as I see no way to
save or get the number of chars I processed jet .
I tried (as mentioned in the first post) to increment a variable
(char_cntr) and compare it with the string-length(), if equals break,
but doesn`t work as I can`t increment variables.

My next idea was to get the number of "char" - children ( which is the
number of yet processed chars) , but children_num remains 0:

  <xsl:template name="string_to_char">
    <xsl:variable name="string_length" select="string-length(@value)"/>
    <xsl:variable name="children_num" select="count(char)"/>
    <xsl:if test="$string_length != $children_num">
      <xsl:element name="char">
        <xsl:attribute name="value">
          <xsl:value-of select="substring(@value, children_num ,1)"/>
        </xsl:attribute>
      </xsl:element>
      <xsl:call-template name="string_to_char"/>
    </xsl:if>
  </xsl:template>

>Apart from this, FXSL has a convenient str-foldl() function/template. It
>implements any char by char string processing.

Thanks, I `ll have a look at that.



transparent
Print
Mail
Like It
Disclaimer
.

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 www.altova.com/list/index.html. 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.

.
.

transparent

transparent