Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2003
    Location
    Philly, PA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to Preserve WhiteSpace in XML?

    I have a web site where users enter text into forms which is then stored into an xml file. I will display that onto a page using xsl to style and format the xml data.

    But, how do I preserve the white space?

    For example...someone enters this in a <textarea> tag:

    This is line 1.

    This is line 2.


    But it shows up like this on the html page:

    This is line 1. This is line 2.

    I want to maintain paragraphs and breaks, etc. Is there someone to do this without making the user enter html tags?

    Thanks.

  • #2
    Senior Coder
    Join Date
    Jul 2002
    Posts
    1,628
    Thanks
    0
    Thanked 0 Times in 0 Posts
    white-space: pre;
    may help you.

    Moderator: General web building

    Get out from under them, resist and multiply.
    Get out from under precipice and see the sky.


  •  

    Posting Permissions

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