Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - translate function grabs both feeds even if I tell it to do one >Thread Next - Re: translate function grabs both feeds even if I tell it to do one Re: translate function grabs both feeds even if I tell it to do oneTo: NULL Date: 3/2/2005 7:58:00 PM Add xml:space='preserve' to the declaration of $LF and $CR (otherwise their contents is stripped by default and their value is the empty string). The rest should be clear. Cheers, Dimitre Novatchev. P.S. So, you can see that the parser has not let in any CRs "Mark Bosley" <mark.nspam@l...> wrote in message news:%23eDLNRrHFHA.1392@T...... >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 | |||
|
