Is there a way to get '&' and '<' '>' values into element (innertext) in xml? .....I keep getting an xml parser error

I have some xml that is processed in my app. And whenever, I submit values that contain ">", "<", or "&", I get a parser error. I have a need to somehow get these characters into the database after the app processes the xml.

I could probably just replace these with some unique strings (">" - to "lessthansign09876" or something.., etc.) and then just replace them with the original charecters on the SQL end in the stored proc.

But isn't there any easier way? Isn't there some way I can make these characters "safe" for xml parsing?


Thanks a bunch all!
OddiCAsked:
Who is Participating?
 
Geert BormansInformation ArchitectCommented:
The parse error you get for & is because it is not followed by a recognised entity
a parser should fai on &, but must not fail on &amp;
maybe your application translate the &amp; back into & to early
how is your setup? what is your application like?
0
 
Geert BormansInformation ArchitectCommented:
> can be escaped as &gt;
< as &lt;
and & as &amp;
0
 
OddiCAuthor Commented:
As I mentioned though- the app fails on parsing "&" sign- I have tried your suggestion before. Is there any other way you can think of?
0
 
OddiCAuthor Commented:
Awesome- that works. I was going to fast while testing and was forgetting the semicolon... Thanks Gertone!
0
 
Geert BormansInformation ArchitectCommented:
welcome
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.