CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002
    Posts
    12

    CRLF problem with MSXML4

    I am using MSXML4 (SP1) on both Win98 and Win2000. When I apply an XSLT transform with an output method of "text", an extra carrige return is printed out at th end of each line. The following transform:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
    <xsl:output method="text" encoding="UTF-8" />
    <xsl:variable name="CR" >
    <xsl:text>&amp;#xA;</xsl:text>
    </xsl:variable>

    <xsl:template match="/">Hello<xsl:value-of select="$CR" />World!</xsl:template>
    </xsl:stylesheet>

    produces the following output when applied to any valid document:

    Hello

    World!

    Looking at the file with a hex editor, I can see:
    48 65 6c 6c 6f 0d 0d 0a 57 6f 72 6c 64 21

    It appears as though there is an extra 0d before the 0d 0a (CR LF). Any ideas why this is happening?

    Thanks in advance,
    Carl Waldbieser
    [email protected]

  2. #2
    Join Date
    Aug 2001
    Location
    Russia, Moscow
    Posts
    26
    From what environment do you use MSXML. Mine works fine.

    I had the same problem with xerces in java.
    Sometimes it happens when two programs windows style and unix style incorrectly work with each other.

    I have solve my problem by string replacement.
    Denis.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured