String w/ & gives error?
I'm saving data into an xml file. Included in the file is a node that has,
for example "R & D Applications". When I try to load or view the file's
data, I get a parsing error thrown up by the "&" sign.
Can anyone tell me how I can get around this?
Cheers!
[293 byte] By [
UK John] at [2007-11-9 15:26:46]

# 1 Re: String w/ & gives error?
How are you creating/saving the XML? If you use a parser, it will automatically
escape it for you. There are other characters the will bite you. Don't
reinvent the wheel and try to do it your self (unless you are an engineer
who likes things to go faster and be smaller). '&' will show up as '&'
in the file (or Stream).
You should be "saving (persisting) XML as a file" not "saving data into an
XML file". Since it is invalid, it really isn't XML. And because a file
has an .xml extension, doesn't mean it is an XML file.
Most languages have tools to do all of this for you. Which one are you using?
VB, Java, .Net, Perl, ... ?
"UK John" <jvotaw@kbcat.com> wrote:
>
>I'm saving data into an xml file. Included in the file is a node that has,
>for example "R & D Applications". When I try to load or view the file's
>data, I get a parsing error thrown up by the "&" sign.
>
>Can anyone tell me how I can get around this?
>
>Cheers!
MarkN at 2007-11-11 23:29:49 >
