ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   XML special character export (https://www.excelbanter.com/excel-discussion-misc-queries/254559-xml-special-character-export.html)

Igors

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!


All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com