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

    Question "New Line" character

    I want to create a variable with the content of new line, so that I can insert it to a string for example "This is a string!" that it becomes "This is \na string!". Does anybody can help with an idea?
    I tried with
    <xsl:variable name="new-line">
    </xsl:variable>

    but it doesnot work. The output is still:
    This is a string!


    If I write this way
    <xsl:variable name="new-line">n
    n</xsl:variable>

    the output string becomes:
    This is n
    na string!

    The new line works. But the problem is that I donot want the two 'n's

    Thanks very much in advance!

  2. #2
    Join Date
    Apr 2002
    Posts
    388
    Take a look here! perhaps something could help you with your problem...
    mfg Ungi

    Music, music and VB. VB is like music: You never know how it is interpreted.

  3. #3
    Join Date
    Jun 2002
    Posts
    137
    thanks!
    I am checking.

  4. #4
    Join Date
    Jul 2002
    Location
    Don't Know, Don't Care
    Posts
    346
    some background info:

    unix return: \n
    c++ return: \n
    DOS/windows return: \r\n

    windows automatically parses \n to be \r\n. I think unix will choke on the \r.

    what if you try this:

    <xsl:variable name="new-line">
    "This is some Text '\n' This is some More Text."
    </xsl:variable>

    haven't tested it, it's just a thought

    C G C F A D--Feel the Noise

    "When your life goes nowhere and leads back to me, doesn't that tell you something?"
    ~Gray Area Fury

  5. #5
    Join Date
    Jun 2002
    Posts
    137
    the new line character for xml is & # x A ;
    \r \n donot work

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