View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Igors Igors is offline
external usenet poster
 
Posts: 1
Default XML special character export

Im 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 doesnt 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 apostrophes (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!