+ Start a Discussion

XML Ampersand issue

We are working on a project that has an XML import routine written. Would anyone know why below is not allowing special characters to be inserted into salesforce fields. Would anyone be able to identify quickly why this is not working properly?

this is a sample of the xml
<company>before &amp; after</company>

We are pulling the data from a server . Once we get the XML data we parse this data using Xmlstreamreader . But we are getting issues with spacial character .  Xmlstreamreader not accepting these spacial characters

here is the code
Xmlstreamreader reader = new Xmlstreamreader(getxml);

while(reader.hasNext()) {
      if (reader.getEventType() == XmlTag.START_ELEMENT) {
         if ('event' == reader.getLocalName()) {
          event.N200_Event_Code__c=reader.getAttributeValue(null, 'code');
         else if('name' == reader.getLocalName()){     
      //     system.debug('%%%%%%%%event.name'+event.name);         
        else if('description' == reader.getLocalName()){     
        //   system.debug('%%%%%%%%event.name'+event.name);