Welcome to WebmasterWorld Guest from 54.196.244.45

Forum Moderators: httpwebwitch

Message Too Old, No Replies

How do I keep linebreaks?

     
12:49 am on Mar 29, 2006 (gmt 0)

New User

10+ Year Member

joined:Sept 7, 2004
posts:34
votes: 0


Does anyone know how as easy as possible to keep the linebreaks in a raw text, I have manually added text into a XML file with linebreaks, but all shows up as one huge text with no linebreaks.

Also to mention that, I am using PHP 4 to manage XML.

3:01 pm on Mar 29, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 17, 2001
posts:1262
votes: 0


Make sure your <xsl:output method="xml"> and try putting xml:space="preserve" on the root element of your source XML, e.g.

<mydoc xml:space="preserve">
...
</mydoc>

3:16 pm on Mar 29, 2006 (gmt 0)

New User

10+ Year Member

joined:Sept 7, 2004
posts:34
votes: 0


Do i put these lines in a seperate file? I havent used XSL with my XML file and not sure how it works in PHP.
3:32 pm on Mar 29, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 17, 2001
posts:1262
votes: 0


Sorry, outside my range. Maybe try the PHP forum?
7:46 pm on Mar 30, 2006 (gmt 0)

Preferred Member

10+ Year Member

joined:Feb 27, 2003
posts:637
votes: 0


roxpace,
I just posted in another thread about an article that I found that shows how to use XML/XSL transformations in PHP.

[webmasterworld.com ]

1:15 am on Apr 1, 2006 (gmt 0)

New User

10+ Year Member

joined:Sept 7, 2004
posts:34
votes: 0


Thanks for that, but didnt found a clear answer there.

What I know that should be possible to do with a XSLT. But how?