Subject: Re: [xsl] How to filter characters from a string? From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx> Date: Thu, 28 Mar 2002 16:42:54 -0700 |
Another important thing to do is to ignore [non] base-64 characters in the stream. During encoding I dropped carriage returns and line feeds into the stream to break up the lines. It is also allowed to drop other non base-64 characters into the stream. For these reasons, I scan and remove non base-64 characters from the stream before decoding.
<!-- Begin Template: str:filter --> <xsl:template name="str:filter"> <xsl:param name="string"/> <xsl:param name="validChars"/> <xsl:if test="$string and $validChars"> <xsl:variable name="first" select="substring($string, 1, 1)"/> <xsl:if test="$first and contains($validChars, $first)"> <xsl:value-of select="$first"/> </xsl:if> <xsl:call-template name="str:filter"> <xsl:with-param name="string" select="substring($string, 2)"/> <xsl:with-param name="validChars" select="$validChars"/> </xsl:call-template> </xsl:if> </xsl:template> <!-- End Template: str:filter -->
Greg Faron Integre Technical Publishing Co.
Perhaps I misunderstand what you're trying to do.
You seem to be confusing the act of discarding information with the act of encoding it.
Base64 is a means of encoding binary data as a sequence of ASCII characters which are known to survive simpleminded text transmission protocols like SMTP. The Base64 encoding and decooding operations are inverses of each other. The original sequence of 8 bit bytes is recovered as a result of decoding.
Taking a body of text and removing any character is that is not one of the output characters of the Base64 encoding operation is not the same as encoding that text.
What are you really trying to do?
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to filter characters , naha | Thread | RE: [xsl] How to filter characters , Michael Kay |
RE: [xsl] Looping and assigning int, Meiyu Lin | Date | [xsl] Anyone used catchXSL or anoth, Bryan Kearney |
Month |