XML special character export

I

Igors

I’m having problems with special symbols when exporting XML files from Excel
(MS Office 2003).
Five special XML symbols need to be changed to this:
Left angle bracket < to <
Right angle bracket > to >
Ampersand & to &
Apostrophe ‘ to &apos;
Quotation mark “ to "

With left angle bracket, ampersand and right angle bracket (<, &, >)
everything is ok, because Excel automatically converts them to needed entity
reference, but it doesn’t convert quotation mark and apostrophe (“, ‘).

I wrote a VBA function that replaces the quotation mark “ with " and
apostrophe with &apos;, but since they contain special symbol ampersand (&)
after exporting data to XML, I get something like this:
data is: “text in quotes†(my function converts to "text in quotes")
current XML result: &quot;text in quotes&quot;
but I need: "text in quotes"
OR
data is: text with apostrophe’s (my function converts to apostrophe&apos;s)
current XML result: text with apostrophe&apos;s
but I need: text with apostrophe&apos;s

Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top