• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

insert '&' into the XML text data?

 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
I want to insert the & in the text data of a xml elment. This is referece to my last post.
It is inserted as & in the text data .

Please help.
 
Marshal
Posts: 28137
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Abhijit Das wrote:hi,
I want to insert the & in the text data of a xml elment. This is referece to my last post.


You can edit your posts, you know. But let me close that one, since you now have a new post.


It is inserted as & in the text data .

Please help.


Yes, that's how it is supposed to work. Read about "escaping", it should be near the beginning of your XML book. Why do you consider it to be a problem?
 
Abhijit Das
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

I am inserting using JAVA APIs.
for example,
String str = "Jhon & Paul";

The the String varaible to be inserted into XML file in an element , say,
<names> </names>

I am inserting using XML perser using JAVA APIs.

so, It is inserted as
<names> Jhon & amp; amp; Paul</name>

Note: ignore the space between & and amp;

If i use CDATA , then teh actual text is coming but CDATA. is also there.

Thanks.
reply
    Bookmark Topic Watch Topic
  • New Topic