Removing all blanks from a string
Posted: Wed May 24, 2006 4:10 pm
Hi there,
maybe I'm thinking much to complicated, but all I want to do is to remove all blanks from a string and assign the result to variable. In an act of desperation I created the following function:
But when running my script I receive the message 'A sequence of more than one item is not allowed as result of function str:strip-blanks()'.
Any ideas on this or is there a much simpler solution???
Best regards
- alex
maybe I'm thinking much to complicated, but all I want to do is to remove all blanks from a string and assign the result to variable. In an act of desperation I created the following function:
Code: Select all
<xsl:function name="str:strip-blanks" as="xs:string">
<xsl:param name="myparam" as="xs:string"/>
<xsl:analyze-string regex="\S+" select="$myparam">
<xsl:matching-substring>
<xsl:value-of select="."/>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:function>
Any ideas on this or is there a much simpler solution???
Best regards
- alex