Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

I'm constructing some XML from a mysql database. Everything works fine simply by manually building the XML tags and closing it at the end.

 

My only problem is the text fields that are returned in the XML do not show the linebreaks that are stored in the mysql database.

 

Anyone know how to return them properly?

Posted

Hi ittech

 

Not sure if I understand your problem 100%. The database uses "\r" for carriage return and "\n" for new line feed. However, as far as I know (I might be wrong, as my xml is quite limited). I'm not sure if xml uses carriage return. As this is white space.

 

Try replacing the "\r" with:

& # 13 ;

(no spaces)

 

Also replace the "\n" with:

& # 10 ;

(again no spaces)

 

Hope this helps

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...