Re: [xml] Special chars in XML
- From: Liam R E Quin <liam holoweb net>
- To: samaram s <samaram007 gmail com>
- Cc: xml gnome org
- Subject: Re: [xml] Special chars in XML
- Date: Wed, 29 Dec 2010 17:56:35 -0500
On Wed, 2010-12-29 at 17:35 -0500, samaram s wrote:
I am working with libxml2 library for one of my application.
But in my data there are few strings which has some special characters like
('&' , < , >) etc
You need to escape some of these characters in your data.
For & use & instead.
For < and > use < and >
Inside attribute values, for " and ' use " and '
(you can quote them in other places too but it is not necessary)
For example,
<activity whose="Susan's">R & D budget < 30000</activity>
might be quoted as
<activity whose="Susan's">R & D budget ^lt; 30000</activity>
You only need to quote " in attribute values if " was used for the
quotes and the same with ', like this
<activity whose='Susan's'>....
You do not need to use a DTD for any of this.
Liam
--
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]