473,513 Members | 2,358 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ignoring ampersand characters

Hi,

I am trying to pasrse an XML message fed from another system. It is
not forming the XML correctly and is modifying '&' characters in the
text. So when it has text such as 'this&that' it does not generate
'this&that' but leaves it as 'this&that'.

I have asked the people who generate the xml message to change their
software to work correctly but is there a way I can get around this in
the meantime.

I am using xerces SAX parser version 2.6.2

Thanks for the help.

Andy
Jul 20 '05 #1
2 2610
In article <97**************************@posting.google.com >,
Andy Coleman <ju**@andy-coleman.co.uk> wrote:
I have asked the people who generate the xml message to change their
software to work correctly but is there a way I can get around this in
the meantime.


Not from inside the XML code. But you could run it through something
first to convert the ampersands. On a unix system

sed 's/&/\&amp;/g'

will do it.

-- Richard

Jul 20 '05 #2
ri*****@cogsci.ed.ac.uk (Richard Tobin) wrote in message news:<cj***********@pc-news.cogsci.ed.ac.uk>...
In article <97**************************@posting.google.com >,
Andy Coleman <ju**@andy-coleman.co.uk> wrote:
I have asked the people who generate the xml message to change their
software to work correctly but is there a way I can get around this in
the meantime.


Not from inside the XML code. But you could run it through something
first to convert the ampersands. On a unix system

sed 's/&/\&amp;/g'

will do it.

-- Richard

Thanks Richard, I had come to the same conclusion myself.

Andy
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3624
by: Daniel Tonks | last post by:
OK, here's possibly a weird one. Is there any way to do string comparisons and ignore all non-alphanumeric characters? For instance, check "foobar" and have it match an existing record of "f$#!oo...
2
3502
by: Dean A. Hoover | last post by:
I am attempting to parse an extremely simple xml file that has an embedded DTD using java sax2. Here is the xml file: <?xml version="1.0" ?> <!DOCTYPE foo > <foo> <bar/> </foo>
4
1651
by: Supra | last post by:
why ampersand not showing. at runtime? regards
18
14724
by: SwordAngel | last post by:
Hello, I'm looking for a program that converts characters of different encodings (such as EUC-JP, Big5, GB-18030, etc.) into HTML ampersand escape sequences. Anybody knows where I can find one? ...
2
3564
by: Thierry Lam | last post by:
Let's say I have the following xml tag: <para role="source">a & b</para> Currently, an xml parser will treat & as a special character. Does anyone know the special characters to use around...
2
6690
by: RD | last post by:
Some of the customers in the table I'm trying to see in an XML doc have an ampersand in the data. Looking at them and formatting the XML doc with a style sheet this generates an error. I'm creating...
1
5080
by: Steven Bethard | last post by:
I'm having trouble using the subprocess module on Windows when my command line includes special characters like "&" (ampersand):: .... stdout=subprocess.PIPE, .... ...
0
2443
by: vlsidesign | last post by:
I am a newbie to C, and was hoping to get a little bit better handle on this until I get deeper into pointers, etc. I kind of understand it some, but still unfamiliar because I haven't got to...
4
4199
by: Kiran Makam | last post by:
I am setting the content of a div dynamically using innerHTML property. If the content contains an ampersand, text after the ampersand is disappearing in IE6. It works properly in Firefox. This...
0
7267
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7391
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7553
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
5100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
466
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.