Solved

XML Line Breaks

Posted on 2007-04-02
2
1,997 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
2 Comments
 
LVL 12

Accepted Solution

by:
StuFox100 earned 250 total points
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now