当前位置: 首页>>代码示例>>PHP>>正文


PHP XML_Util::createStartElement方法代码示例

本文整理汇总了PHP中XML_Util::createStartElement方法的典型用法代码示例。如果您正苦于以下问题:PHP XML_Util::createStartElement方法的具体用法?PHP XML_Util::createStartElement怎么用?PHP XML_Util::createStartElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XML_Util的用法示例。


在下文中一共展示了XML_Util::createStartElement方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _serializeToken

 /**
  * serialize a token
  *
  * This method does the actual beautifying.
  *
  * @param array $token structure that should be serialized
  *
  * @return mixed
  * @access private 
  * @todo split this method into smaller methods
  */
 function _serializeToken($token)
 {
     switch ($token["type"]) {
         /*
          * serialize XML Element
          */
         case XML_BEAUTIFIER_ELEMENT:
             $indent = $this->_getIndentString($token["depth"]);
             // adjust tag case
             if ($this->_options["caseFolding"] === true) {
                 switch ($this->_options["caseFoldingTo"]) {
                     case "uppercase":
                         $token["tagname"] = strtoupper($token["tagname"]);
                         $token["attribs"] = array_change_key_case($token["attribs"], CASE_UPPER);
                         break;
                     case "lowercase":
                         $token["tagname"] = strtolower($token["tagname"]);
                         $token["attribs"] = array_change_key_case($token["attribs"], CASE_LOWER);
                         break;
                 }
             }
             if ($this->_options["multilineTags"] == true) {
                 $attIndent = $indent . str_repeat(" ", 2 + strlen($token["tagname"]));
             } else {
                 $attIndent = null;
             }
             // check for children
             switch ($token["contains"]) {
                 // contains only CData or is empty
                 case XML_BEAUTIFIER_CDATA:
                 case XML_BEAUTIFIER_EMPTY:
                     if (sizeof($token["children"]) >= 1) {
                         $data = $token["children"][0]["data"];
                     } else {
                         $data = '';
                     }
                     if (strstr($data, "\n")) {
                         $data = "\n" . $this->_indentTextBlock($data, $token['depth'] + 1, true);
                     }
                     $xml = $indent . XML_Util::createTag($token["tagname"], $token["attribs"], $data, null, XML_UTIL_REPLACE_ENTITIES, $this->_options["multilineTags"], $attIndent) . $this->_options["linebreak"];
                     break;
                     // contains mixed content
                 // contains mixed content
                 default:
                     $xml = $indent . XML_Util::createStartElement($token["tagname"], $token["attribs"], null, $this->_options["multilineTags"], $attIndent) . $this->_options["linebreak"];
                     $cnt = count($token["children"]);
                     for ($i = 0; $i < $cnt; $i++) {
                         $xml .= $this->_serializeToken($token["children"][$i]);
                     }
                     $xml .= $indent . XML_Util::createEndElement($token["tagname"]) . $this->_options["linebreak"];
                     break;
                     break;
             }
             break;
             /*
              * serialize CData
              */
         /*
          * serialize CData
          */
         case XML_BEAUTIFIER_CDATA:
             if ($token["depth"] > 0) {
                 $xml = str_repeat($this->_options["indent"], $token["depth"]);
             } else {
                 $xml = "";
             }
             $xml .= XML_Util::replaceEntities($token["data"]) . $this->_options["linebreak"];
             break;
             /*
              * serialize CData section
              */
         /*
          * serialize CData section
          */
         case XML_BEAUTIFIER_CDATA_SECTION:
             if ($token["depth"] > 0) {
                 $xml = str_repeat($this->_options["indent"], $token["depth"]);
             } else {
                 $xml = "";
             }
             $xml .= '<![CDATA[' . $token["data"] . ']]>' . $this->_options["linebreak"];
             break;
             /*
              * serialize entity
              */
         /*
          * serialize entity
          */
         case XML_BEAUTIFIER_ENTITY:
//.........这里部分代码省略.........
开发者ID:Tony-M,项目名称:tmsApiDoc,代码行数:101,代码来源:XML_Beautifier_Renderer_Plain.php

示例2: htmlentities

 */
print "creating a start element:<br>";
print htmlentities(XML_Util::createStartElement("myNs:myTag", array("foo" => "bar"), "http://www.w3c.org/myNs#"));
print "\n<br><br>\n";
/**
 * creating a start element
 */
print "creating a start element:<br>";
print htmlentities(XML_Util::createStartElement("myTag", array(), "http://www.w3c.org/myNs#"));
print "\n<br><br>\n";
/**
 * creating a start element
 */
print "creating a start element:<br>";
print "<pre>";
print htmlentities(XML_Util::createStartElement("myTag", array("foo" => "bar", "argh" => "tomato"), "http://www.w3c.org/myNs#", true));
print "</pre>";
print "\n<br><br>\n";
/**
 * creating an end element
 */
print "creating an end element:<br>";
print htmlentities(XML_Util::createEndElement("myNs:myTag"));
print "\n<br><br>\n";
/**
 * creating a CData section
 */
print "creating a CData section:<br>";
print htmlentities(XML_Util::createCDataSection("I am content."));
print "\n<br><br>\n";
/**
开发者ID:BackupTheBerlios,项目名称:dilps,代码行数:31,代码来源:example2.php

示例3: _printTagList

 /**
  * Print a group of same tag in the XML report.
  *
  * Groups list are : extension(s), constant(s), token(s)
  *
  * @param array  $dataSrc Data source
  * @param string $tagName Name of the XML tag
  *
  * @return string
  * @access private
  * @since  version 1.7.0b4 (2008-04-03)
  */
 function _printTagList($dataSrc, $tagName)
 {
     $msg = '';
     if ($tagName == 'function') {
         $c = 0;
         foreach ($dataSrc as $version => $functions) {
             $c += count($functions);
         }
         $attributes = array('count' => $c);
     } elseif ($tagName == 'condition') {
         if ($this->_parser->options['debug'] === true) {
             $c = 0;
             foreach ($dataSrc[1] as $cond => $elements) {
                 $c += count($elements);
             }
             $attributes = array('count' => $c, 'level' => $dataSrc[0]);
         } else {
             $attributes = array('level' => $dataSrc[0]);
         }
     } else {
         $attributes = array('count' => count($dataSrc));
     }
     $msg .= XML_Util::createStartElement($tagName . 's', $attributes);
     $msg .= PHP_EOL;
     if ($tagName == 'function') {
         foreach ($dataSrc as $version => $functions) {
             foreach ($functions as $data) {
                 $attr = array('version' => $version);
                 if (!empty($data['extension'])) {
                     $attr['extension'] = $data['extension'];
                     $attr['pecl'] = $data['pecl'] === true ? 'true' : 'false';
                 }
                 $tag = array('qname' => $tagName, 'attributes' => $attr, 'content' => $data['function']);
                 $msg .= XML_Util::createTagFromArray($tag);
                 $msg .= PHP_EOL;
             }
         }
     } elseif ($tagName == 'condition') {
         if ($this->_parser->options['debug'] == true) {
             foreach ($dataSrc[1] as $cond => $elements) {
                 $cond = $cond == 0 ? 1 : $cond * 2;
                 foreach ($elements as $data) {
                     $tag = array('qname' => $tagName, 'attributes' => array('level' => $cond), 'content' => $data);
                     $msg .= XML_Util::createTagFromArray($tag);
                     $msg .= PHP_EOL;
                 }
             }
         }
     } else {
         foreach ($dataSrc as $data) {
             $tag = array('qname' => $tagName, 'attributes' => array(), 'content' => $data);
             $msg .= XML_Util::createTagFromArray($tag);
             $msg .= PHP_EOL;
         }
     }
     $msg .= XML_Util::createEndElement($tagName . 's');
     $msg .= PHP_EOL;
     return $msg;
 }
开发者ID:ryo88c,项目名称:BEAR.Saturday,代码行数:71,代码来源:Xml.php

示例4: baz_afficher_flux_RSS

/** baz_affiche_flux_RSS() - affiche le flux rss a partir de parametres
 * @return  string Le flux RSS, avec les headers et tout et tout
 */
function baz_afficher_flux_RSS()
{
    $urlrss = $GLOBALS['wiki']->href('rss');
    if (isset($_GET['id_typeannonce'])) {
        $id_typeannonce = $_GET['id_typeannonce'];
        $urlrss .= '&amp;id_typeannonce=' . $id_typeannonce;
    } else {
        $id_typeannonce = '';
    }
    if (isset($_GET['categorie_fiche'])) {
        $categorie_fiche = $_GET['categorie_fiche'];
        $urlrss .= '&amp;categorie_fiche=' . $categorie_fiche;
    } else {
        $categorie_fiche = '';
    }
    if (isset($_GET['nbitem'])) {
        $nbitem = $_GET['nbitem'];
        $urlrss .= '&amp;nbitem=' . $nbitem;
    } else {
        $nbitem = BAZ_NB_ENTREES_FLUX_RSS;
    }
    if (isset($_GET['utilisateur'])) {
        $utilisateur = $_GET['utilisateur'];
        $urlrss .= '&amp;utilisateur=' . $utilisateur;
    } else {
        $utilisateur = '';
    }
    if (isset($_GET['statut'])) {
        $statut = $_GET['statut'];
        $urlrss .= '&amp;statut=' . $statut;
    } else {
        $statut = 1;
    }
    if (isset($_GET['query'])) {
        $query = $_GET['query'];
        $urlrss .= '&amp;query=' . $query;
    } else {
        $query = '';
    }
    $tableau_flux_rss = baz_requete_recherche_fiches($query, '', $id_typeannonce, $categorie_fiche, $statut, $utilisateur, 20);
    require_once BAZ_CHEMIN . 'libs' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'XML/Util.php';
    // setlocale() pour avoir les formats de date valides (w3c) --julien
    setlocale(LC_TIME, 'C');
    $xml = XML_Util::getXMLDeclaration('1.0', 'UTF-8', 'yes');
    $xml .= "\r\n  ";
    $xml .= XML_Util::createStartElement('rss', array('version' => '2.0', 'xmlns:atom' => 'http://www.w3.org/2005/Atom', 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/'));
    $xml .= "\r\n    ";
    $xml .= XML_Util::createStartElement('channel');
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('title', null, html_entity_decode(_t('BAZ_DERNIERE_ACTU'), ENT_QUOTES, 'UTF-8'));
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('link', null, html_entity_decode(BAZ_RSS_ADRESSESITE, ENT_QUOTES, 'UTF-8'));
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('description', null, html_entity_decode(BAZ_RSS_DESCRIPTIONSITE, ENT_QUOTES, 'UTF-8'));
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('language', null, 'fr-FR');
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('copyright', null, 'Copyright (c) ' . date('Y') . ' ' . html_entity_decode(BAZ_RSS_NOMSITE, ENT_QUOTES, 'UTF-8'));
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('lastBuildDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT'));
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('docs', null, 'http://www.stervinou.com/projets/rss/');
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('category', null, BAZ_RSS_CATEGORIE);
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('managingEditor', null, BAZ_RSS_MANAGINGEDITOR);
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('webMaster', null, BAZ_RSS_WEBMASTER);
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('ttl', null, '60');
    $xml .= "\r\n      ";
    $xml .= XML_Util::createStartElement('image');
    $xml .= "\r\n        ";
    $xml .= XML_Util::createTag('title', null, html_entity_decode(_t('BAZ_DERNIERE_ACTU'), ENT_QUOTES, 'UTF-8'));
    $xml .= "\r\n        ";
    $xml .= XML_Util::createTag('url', null, BAZ_RSS_LOGOSITE);
    $xml .= "\r\n        ";
    $xml .= XML_Util::createTag('link', null, BAZ_RSS_ADRESSESITE);
    $xml .= "\r\n      ";
    $xml .= XML_Util::createEndElement('image');
    if (count($tableau_flux_rss) > 0) {
        // Creation des items : titre + lien + description + date de publication
        foreach ($tableau_flux_rss as $ligne) {
            $ligne = json_decode($ligne['body'], true);
            $ligne = _convert($ligne, 'UTF-8');
            $xml .= "\r\n      ";
            $xml .= XML_Util::createStartElement('item');
            $xml .= "\r\n        ";
            $xml .= XML_Util::createTag('title', null, html_entity_decode(stripslashes($ligne['bf_titre']), ENT_QUOTES, 'UTF-8'));
            $xml .= "\r\n        ";
            $lien = $GLOBALS['_BAZAR_']['url'];
            $lien->addQueryString(BAZ_VARIABLE_ACTION, BAZ_VOIR_FICHE);
            $lien->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_CONSULTER);
            $lien->addQueryString('id_fiche', $ligne['id_fiche']);
            $xml .= XML_Util::createTag('link', null, '<![CDATA[' . $lien->getURL() . ']]>');
            $xml .= "\r\n        ";
            $xml .= XML_Util::createTag('guid', null, '<![CDATA[' . $lien->getURL() . ']]>');
//.........这里部分代码省略.........
开发者ID:YesWiki,项目名称:yeswiki-sandstorm,代码行数:101,代码来源:bazar.fonct.php

示例5: baz_afficher_flux_RSS

/** baz_affiche_flux_RSS() - affiche le flux rss à partir de parametres
*
*
* @return  string Le flux RSS, avec les headers et tout et tout
*/
function baz_afficher_flux_RSS()
{
    if (isset($_GET['id_typeannonce'])) {
        $id_typeannonce = $_GET['id_typeannonce'];
    } else {
        $id_typeannonce = $GLOBALS['_BAZAR_']['id_typeannonce'];
    }
    if (isset($_GET['categorie_fiche'])) {
        $categorie_fiche = $_GET['categorie_fiche'];
    } else {
        $categorie_fiche = $GLOBALS['_BAZAR_']['categorie_nature'];
    }
    if (isset($_GET['nbitem'])) {
        $nbitem = $_GET['nbitem'];
    } else {
        $nbitem = BAZ_NB_ENTREES_FLUX_RSS;
    }
    if (isset($_GET['utilisateur'])) {
        $utilisateur = $_GET['utilisateur'];
    } else {
        $utilisateur = '';
    }
    if (isset($_GET['statut'])) {
        $statut = $_GET['statut'];
    } else {
        $statut = 1;
    }
    if (isset($_GET['query'])) {
        $query = $_GET['query'];
    } else {
        $query = '';
    }
    $tableau_flux_rss = baz_requete_recherche_fiches($query, '', $id_typeannonce, $categorie_fiche, $statut, $utilisateur, 20);
    require_once 'XML/Util.php';
    // setlocale() pour avoir les formats de date valides (w3c) --julien
    setlocale(LC_TIME, "C");
    $xml = XML_Util::getXMLDeclaration('1.0', 'UTF-8', 'yes');
    $xml .= "\r\n  ";
    $xml .= XML_Util::createStartElement('rss', array('version' => '2.0', 'xmlns:atom' => "http://www.w3.org/2005/Atom"));
    $xml .= "\r\n    ";
    $xml .= XML_Util::createStartElement('channel');
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('title', null, utf8_encode(html_entity_decode(BAZ_DERNIERE_ACTU)));
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('link', null, utf8_encode(html_entity_decode(BAZ_RSS_ADRESSESITE)));
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('description', null, utf8_encode(html_entity_decode(BAZ_RSS_DESCRIPTIONSITE)));
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('language', null, 'fr-FR');
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('copyright', null, 'Copyright (c) ' . date('Y') . ' ' . utf8_encode(html_entity_decode(BAZ_RSS_NOMSITE)));
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('lastBuildDate', null, strftime('%a, %d %b %Y %H:%M:%S GMT'));
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('docs', null, 'http://www.stervinou.com/projets/rss/');
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('category', null, BAZ_RSS_CATEGORIE);
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('managingEditor', null, BAZ_RSS_MANAGINGEDITOR);
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('webMaster', null, BAZ_RSS_WEBMASTER);
    $xml .= "\r\n      ";
    $xml .= XML_Util::createTag('ttl', null, '60');
    $xml .= "\r\n      ";
    $xml .= XML_Util::createStartElement('image');
    $xml .= "\r\n        ";
    $xml .= XML_Util::createTag('title', null, utf8_encode(html_entity_decode(BAZ_DERNIERE_ACTU)));
    $xml .= "\r\n        ";
    $xml .= XML_Util::createTag('url', null, BAZ_RSS_LOGOSITE);
    $xml .= "\r\n        ";
    $xml .= XML_Util::createTag('link', null, BAZ_RSS_ADRESSESITE);
    $xml .= "\r\n      ";
    $xml .= XML_Util::createEndElement('image');
    if (count($tableau_flux_rss) > 0) {
        // Creation des items : titre + lien + description + date de publication
        foreach ($tableau_flux_rss as $ligne) {
            $ligne = json_decode($ligne[0], true);
            $ligne = array_map('utf8_decode', $ligne);
            $xml .= "\r\n      ";
            $xml .= XML_Util::createStartElement('item');
            $xml .= "\r\n        ";
            $xml .= XML_Util::createTag('title', null, encoder_en_utf8(html_entity_decode(stripslashes($ligne['bf_titre']))));
            $xml .= "\r\n        ";
            $lien = $GLOBALS['_BAZAR_']['url'];
            $lien->addQueryString(BAZ_VARIABLE_ACTION, BAZ_VOIR_FICHE);
            $lien->addQueryString(BAZ_VARIABLE_VOIR, BAZ_VOIR_CONSULTER);
            $lien->addQueryString('id_fiche', $ligne['id_fiche']);
            $xml .= XML_Util::createTag('link', null, '<![CDATA[' . $lien->getURL() . ']]>');
            $xml .= "\r\n        ";
            $xml .= XML_Util::createTag('guid', null, '<![CDATA[' . $lien->getURL() . ']]>');
            $xml .= "\r\n        ";
            $tab = explode("wakka.php?wiki=", $lien->getURL());
            $xml .= XML_Util::createTag('description', null, '<![CDATA[' . encoder_en_utf8(html_entity_decode(baz_voir_fiche(0, $ligne))) . ']]>');
            $xml .= "\r\n        ";
            if ($ligne['date_debut_validite_fiche'] != '0000-00-00' && $ligne['date_debut_validite_fiche'] > $ligne['date_creation_fiche']) {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:wikiplug,代码行数:101,代码来源:bazar.fonct.php

示例6: _prepareQueryString

 /**
  * Prepare the PUT query xml.
  *
  * @access private
  * @return string The query xml
  */
 function _prepareQueryString()
 {
     $data = array_merge($this->_options, $this->_data);
     $doc = XML_Util::getXMLDeclaration();
     $doc .= '<!DOCTYPE paymentService PUBLIC "-//Bibit//DTD Bibit PaymentService v1//EN" "http://dtd.bibit.com/paymentService_v1.dtd">';
     $doc .= XML_Util::createStartElement('paymentService', array('version' => $data['x_version'], 'merchantCode' => $data['x_login']));
     if ($data['x_action'] == PAYMENT_PROCESS_ACTION_BIBIT_CAPTURE || $data['x_action'] == PAYMENT_PROCESS_ACTION_BIBIT_REFUND) {
         $doc .= XML_Util::createStartElement('modify');
         $doc .= XML_Util::createStartElement('orderModification', array('orderCode' => $data['x_ordercode']));
         if ($data['x_action'] == PAYMENT_PROCESS_ACTION_BIBIT_CAPTURE) {
             $doc .= XML_Util::createStartElement('capture');
             $d = array();
             $t = time() - 86400;
             $d['dayOfMonth'] = date('d', $t);
             $d['month'] = date('m', $t);
             $d['year'] = date('Y', $t);
             $d['hour'] = date('H', $t);
             $d['minute'] = date('i', $t);
             $d['second'] = date('s', $t);
             $doc .= XML_Util::createTag('date', $d);
             $doc .= XML_Util::createTag('amount', array('value' => $data['x_amount'], 'currencyCode' => $data['x_currency'], 'exponent' => $data['x_exponent']));
             $doc .= XML_Util::createEndElement('capture');
         } else {
             if ($data['x_action'] == PAYMENT_PROCESS_ACTION_BIBIT_REFUND) {
                 $doc .= XML_Util::createStartElement('refund');
                 $doc .= XML_Util::createTag('amount', array('value' => $data['x_amount'], 'currencyCode' => $data['x_currency'], 'exponent' => $data['x_exponent']));
                 $doc .= XML_Util::createEndElement('refund');
             }
         }
         $doc .= XML_Util::createEndElement('orderModification');
         $doc .= XML_Util::createEndElement('modify');
     } else {
         $doc .= XML_Util::createStartElement('submit');
         $doc .= XML_Util::createStartElement('order', array('orderCode' => $data['x_ordercode']));
         $doc .= XML_Util::createTag('description', null, $data['x_descr']);
         $doc .= XML_Util::createTag('amount', array('value' => $data['x_amount'], 'currencyCode' => $data['x_currency'], 'exponent' => $data['x_exponent']));
         if (isset($data['x_ordercontent'])) {
             $doc .= XML_Util::createStartElement('orderContent');
             $doc .= XML_Util::createCDataSection($data['x_ordercontent']);
             $doc .= XML_Util::createEndElement('orderContent');
         }
         if ($data['x_action'] == PAYMENT_PROCESS_ACTION_BIBIT_REDIRECT) {
             if (is_array($data['paymentMethodMask']) && count($data['paymentMethodMask'] > 0)) {
                 $doc .= XML_Util::createStartElement('paymentMethodMask');
                 foreach ($data['paymentMethodMask']['include'] as $code) {
                     $doc .= XML_Util::createTag('include', array('code' => $code));
                 }
                 foreach ($data['paymentMethodMask']['exclude'] as $code) {
                     $doc .= XML_Util::createTag('exclude', array('code' => $code));
                 }
                 $doc .= XML_Util::createEndElement('paymentMethodMask');
             }
         } else {
             if ($data['x_action'] == PAYMENT_PROCESS_ACTION_BIBIT_AUTH) {
                 $doc .= XML_Util::createStartElement('paymentDetails');
                 switch ($this->_payment->type) {
                     case PAYMENT_PROCESS_CC_VISA:
                         $cc_type = 'VISA-SSL';
                         break;
                     case PAYMENT_PROCESS_CC_MASTERCARD:
                         $cc_type = 'ECMC-SSL';
                         break;
                     case PAYMENT_PROCESS_CC_AMEX:
                         $cc_type = 'AMEX-SSL';
                         break;
                 }
                 $doc .= XML_Util::createStartElement($cc_type);
                 if (isset($data['x_card_num'])) {
                     $doc .= XML_Util::createTag('cardNumber', null, $data['x_card_num']);
                 }
                 if (isset($data['x_exp_date'])) {
                     $doc .= XML_Util::createStartElement('expiryDate');
                     $doc .= XML_Util::createTag('date', array('month' => substr($data['x_exp_date'], 0, 2), 'year' => substr($data['x_exp_date'], 3, 4)));
                     $doc .= XML_Util::createEndElement('expiryDate');
                 }
                 if (isset($this->_payment->firstName) && isset($this->_payment->lastName)) {
                     $doc .= XML_Util::createTag('cardHolderName', null, $this->_payment->firstName . ' ' . $this->_payment->lastName);
                 }
                 if (isset($data['x_card_code'])) {
                     $doc .= XML_Util::createTag('cvc', null, $data['x_card_code']);
                 }
                 $doc .= XML_Util::createEndElement($cc_type);
                 if ((isset($data['shopperIPAddress']) || isset($data['sessionId'])) && ($data['shopperIPAddress'] != '' || $data['sessionId'] != '')) {
                     $t = array();
                     if ($data['shopperIPAddress'] != '') {
                         $t['shopperIPAddress'] = $data['shopperIPAddress'];
                     }
                     if ($data['sessionId'] != '') {
                         $t['id'] = $data['sessionId'];
                     }
                     $doc .= XML_Util::createTag('session', $t);
                     unset($t);
                 }
                 $doc .= XML_Util::createEndElement('paymentDetails');
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:Bibit.php

示例7: exportXML

 function exportXML()
 {
     global $i18n, $ClassDir;
     require_once 'XML/Util.php';
     require_once $ClassDir . 'StringHelper.class.php';
     $header = array("name", "gender", "birthday", "mobile", "phone", "office_phone", "fax", "addrees", "category", "email", "homepage");
     $filename = date("Y_m_d") . "_contact_export.xml";
     $xml_data = "";
     $xml = new XML_Util();
     $xml_data .= $xml->getXMLDeclaration("1.0", "UTF-8") . "\n";
     $xml_data .= "" . $xml->createStartElement("contact") . "\n";
     //		Write contact record
     $apf_contact = DB_DataObject::factory('ApfContact');
     $apf_contact->orderBy('id desc');
     $apf_contact->find();
     while ($apf_contact->fetch()) {
         $xml_data .= "\t" . $xml->createStartElement("record") . "\n";
         foreach ($header as $title) {
             $coloum_function = "get" . StringHelper::CamelCaseFromUnderscore($title);
             $tag = array("qname" => $title, "content" => $apf_contact->{$coloum_function}());
             $xml_data .= "\t\t" . $xml->createTagFromArray($tag) . "\n";
         }
         $xml_data .= "\t" . $xml->createEndElement("record") . "\n";
     }
     $xml_data .= "" . $xml->createEndElement("contact") . "\n";
     $xml->send($xml_data, $filename);
     exit;
 }
开发者ID:BackupTheBerlios,项目名称:flushcms,代码行数:28,代码来源:ApfContact.class.php


注:本文中的XML_Util::createStartElement方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。