You are here

function cc::xml_create_parser in Constant Contact 7.3

Same name and namespace in other branches
  1. 6.3 class.cc.php \cc::xml_create_parser()
  2. 6.2 class.cc.php \cc::xml_create_parser()

Return XML parser, and possibly re-encoded source.

@access private

1 call to cc::xml_create_parser()
cc::xml_to_array in ./class.cc.php
Converts a string comtaining XML into a nicely formatted PHP array.

File

./class.cc.php, line 1722
Constant Contact PHP Class

Class

cc
@file Constant Contact PHP Class

Code

function xml_create_parser($source, $out_enc, $in_enc, $detect) {
  if (drupal_substr(phpversion(), 0, 1) == 5) {
    $parser = $this
      ->xml_php5_create_parser($in_enc, $detect);
  }
  else {
    list($parser, $source) = $this
      ->xml_php4_create_parser($source, $in_enc, $detect);
  }
  if ($out_enc) {
    $this->xml_encoding = $out_enc;
    xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $out_enc);
  }
  return array(
    $parser,
    $source,
  );
}