Solved

XML Line Breaks

Posted on 2007-04-02
2
2,012 Views
Last Modified: 2013-11-19
New at xml and XSLT but I have manage to get reference the xslt file with the xml file..  Now I have another question.. one of my nodes in the xml file contains a sentence that should have line breaks but I don't know how to add them.  The line displayed in my browser goes across the screen.
0
Comment
Question by:moralju
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
StuFox100 earned 250 total points
ID: 18841195
Assuming you have the line breaks in the XML file, I think you want this:
<xsl:preserve-space elements="list-of-element-names"/>
A useful site to help develop your skills is http://www.w3schools.com/
Cheers
Stu
0
 
LVL 60

Assisted Solution

by:Geert Bormans
Geert Bormans earned 250 total points
ID: 18841560
preserve-space will not work in a browser.

I assume you are transforming to (X)HTML.
If you do, you could put the part of the XML that requires preserving the spaces in a <pre> tag.
This is preformatted text and will keep the whitespace and show it in the browser

If you want to force a newline in a browser, you will need to add a <br />

You can force the HTML to wrap lines and not go outside your browser window by adding a CSS property "wrap"

various possibilities, depending on what you need

cheers

Geert
0

Featured Post

How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question