Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

APOSTROPHE inside xml element value

Tags:

sql

xml

How Should I write an elements value inside an XML which contains apostrophe? Is there an escape sequence for the same?

I am dynamically getting an xml, something like this from a sql Select. Now in this case emp_name O''DELL, SEAN in itself contains apostrophe. How should I be getting emp_name so a proper xml could be formed?

<Result type="Benefit" emp_id='332' emp_name='O''DELL, SEAN '/>

Thanks Guys.

like image 668
Tintin Avatar asked Mar 16 '11 20:03

Tintin


1 Answers

Use &apos; in place of '. Check this.

like image 171
amit_g Avatar answered Sep 23 '22 19:09

amit_g