Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: translate function grabs both feeds even if I tell it to do one translate function grabs both feeds even if I tell it to do oneTo: NULL Date: 3/1/2005 5:15:00 PM I know Xml parsers are supposed to convert CRLF's to LF only. But in the stylesheet below I can see CR's. So I tried to strip out CR's with a translate function. But when I do that, the LF's are gone too. The stylesheet below produces T has LF's T has CR's I am expecting B has LF's B has CR's T has LF's <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"> <xsl:output method="text" /> <xsl:variable name="T">Extensible Stylesheet Language Transformations. along with the XML Path. This is a point and another: and yet another: </xsl:variable> <xsl:variable name="CR">
</xsl:variable> <xsl:variable name="LF">
</xsl:variable> <xsl:variable name="B"><xsl:value-of select="translate($T, $CR, '')"/></xsl:variable> <xsl:template match="/"> <root> <xsl:if test="contains($B, $LF)">B has LF's </xsl:if> <xsl:if test="contains($B, $CR)">B has CR's </xsl:if> <xsl:if test="contains($T, $LF)">T has LF's </xsl:if> <xsl:if test="contains($T, $CR)">T has CR's </xsl:if> </root> </xsl:template> </xsl:stylesheet> If the translate function is something like <xsl:value-of select="translate($T, 'A', 'B')"/> then CF and LF stays put. Any ideas? Thanks Mark B | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
