Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5932167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:47:50+00:00 2026-05-22T14:47:50+00:00

New Line in xslt is creating a problem for me. i searched a lot

  • 0

New Line in xslt is creating a problem for me. i searched a lot and found many ways of inserting a new line character in xslt. but nothing is working out. I tried using
<xsl:text></xsl:text>, <xsl:text>&#xa;</xsl:text> and many such other new line characters. but failed. I dont wanna use any html characters like <br/> n all. I just wanna know how will i get a new line in xslt.Does it depend on the os used, processor, xslt version or anything?

output what i want is:

Dear abc,
You Have received a Mail.

but i am getting it as:

Dear abc, You have received a mail.

i even used

<?xml version="1.0"?>
<xsl:stylesheet version="2.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xsl:output method="text"/>

  <xsl:template match="/">
    <xsl:text>&#xA; 1 &#xA; 2 &#xA; </xsl:text>

  </xsl:template>
</xsl:stylesheet>

but still it shows 1 2 in one line.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:47:51+00:00Added an answer on May 22, 2026 at 2:47 pm

    Based on the responses in the comment section the cause of your problem seems to be simply that you created a “.html” result file and then looked at that in a browser which applies HTML display rules where new lines are usually simply collapsed to spaces.
    So the solution to the problem is to simply ensure you create a “.txt” file instead, that way your new lines will be displayed when looking at the file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When inserting a new line character into a string I have usually done this:
How to prevent the new line character at the beginning of the text entering
How do you append a new line(\n\r) character in StringBuilder ?
My JSON contains special characters like: new line, double quotes etc. I am creating
I wanted to append a new line to the end of a file, but
I'm having a problem. How can I instruct my XSLT to insert a new
How to use new line character in servlet with out.println(\n Organization_name:); Is it right?
We know some escape sequence '\n' - new line but say we don't know
I know I can insert new line with shift+enter but how can I insert
I've seen the new line \n used 2 different ways in a few code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.