Hi,

I currently have a xml document like so:

PHP Code:
<industries>
    <
element value="">--- Select One ---</element>
    <
element value="US">Advertising &ampMedia</element>
    <
element value="AF">Finance/Accountancy</element>
</
industries
I have a php script that parse the xml data from the above file, but the problem now is that the special characters &amp; is being truncated out. For example: "Advertising &amp; Media" becomes "Media"

My Xml parsing script is like so:

PHP Code:
class XMLParser
{


    function 
XMLParser( )
    {
        
$this->stack   = array( );
        
$this->element = array( );
        
$this->parser  xml_parser_create( );

        
// Set XML parser to take the case of tags in to account
        
xml_parser_set_option$this->parserXML_OPTION_CASE_FOLDINGfalse );

        
xml_set_object$this->parser$this );
        
xml_set_element_handler$this->parser'tagOpen''tagClose' );
        
xml_set_character_data_handler$this->parser'cdata' );
    }
    

    function 
loadFromFile$filepath )
    {
        if( !( 
$fp = @fopen$filepath'r' ) ) )
        {
            
$this->errno   '';
            
$this->errmsg  "Invalid file: $filepath";
            
$this->errline __LINE__;
            return 
false
        }
        else
        {
            while( 
$xmlData fread$fp4096 ) )
            {
                if( !
xml_parse$this->parser$xmlDatafeof$fp ) ) )
                {
                    
$this->errno   xml_get_error_code$this->parser );
                    
$this->errmsg  xml_error_string$this->errno );
                    
$this->errline xml_get_current_line_number$this->parser );
                    return 
false;
                }
            }
            
            
fclose($fp);
            
xml_parser_free$this->parser );
            return 
true;
        }
    }
    
    
    function 
tagOpen$parser$name$attrs )
    {
        if( isset( 
$attrs['value'] ) && trim$attrs['value'] ) != '' )
        {
            
$this->current $attrs['value'];
            
$this->arrayList[$attrs['value']] = '';
        }
    }


    function 
tagClose$parser$name )
    {
        if( 
$name == 'element' )
        {
            
$this->arrayList[$this->current] = $this->content;
        }
    }
    
    
    function 
cdata$parser$cdata )
    {
        
$this->content $cdata;
    }

Would really appreciate if someone could help. Thanks.