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


PHP domxml_open_mem函数代码示例

本文整理汇总了PHP中domxml_open_mem函数的典型用法代码示例。如果您正苦于以下问题:PHP domxml_open_mem函数的具体用法?PHP domxml_open_mem怎么用?PHP domxml_open_mem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: _testXPath

 function _testXPath($xpath_expression)
 {
     if (!class_exists('DOMDocument') || !class_exists('DOMXPath')) {
         if (function_exists('domxml_open_mem')) {
             $dom = domxml_open_mem($this->_response);
             if (!$dom) {
                 $this->fail('Error parsing doc');
                 return false;
             }
             var_dump($dom);
             $xpath = $dom->xpath_init();
             var_dump($xpath);
             $ctx = $dom->xpath_new_context();
             var_dump($xpath_expression);
             $result = $ctx->xpath_eval($xpath_expression);
             var_dump($result);
             $return = new stdClass();
             $return->length = count($result->nodeset);
             return $return;
         }
         $this->fail('No xpath support built in');
         return false;
     } else {
         if (extension_loaded('domxml')) {
             $this->fail('Please disable the domxml extension. Only php5 builtin domxml is supported');
             return false;
         }
     }
     $dom = new DOMDocument();
     $dom->loadHtml($this->_response);
     $xpath = new DOMXPath($dom);
     $node = $xpath->query($xpath_expression);
     return $node;
 }
开发者ID:joeymetal,项目名称:v1,代码行数:34,代码来源:AkTestApplication.php

示例2: Main

 function Main()
 {
     $this->tpl->set_block("rptsTemplate", "MunicipalityCityList", "MunicipalityCityListBlock");
     $MunicipalityCityList = new SoapObject(NCCBIZ . "MunicipalityCityList.php", "urn:Object");
     if (!($xmlStr = $MunicipalityCityList->getMunicipalityCityList(0, " WHERE " . MUNICIPALITYCITY_TABLE . ".status='active'"))) {
         $this->tpl->set_var("municipalityCityID", "");
         $this->tpl->set_var("description", "empty list");
         $this->tpl->parse("MunicipalityCityListBlock", "MunicipalityCityList", true);
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_var("municipalityCityID", "");
             $this->tpl->set_var("description", "empty list");
             $this->tpl->parse("MunicipalityCityListBlock", "MunicipalityCityList", true);
         } else {
             $municipalityCityRecords = new MunicipalityCityRecords();
             $municipalityCityRecords->parseDomDocument($domDoc);
             $list = $municipalityCityRecords->getArrayList();
             foreach ($list as $municipalityCity) {
                 $this->tpl->set_var("municipalityCityID", $municipalityCity->getMunicipalityCityID());
                 $this->tpl->set_var("description", $municipalityCity->getDescription());
                 $this->tpl->parse("MunicipalityCityListBlock", "MunicipalityCityList", true);
             }
         }
     }
     $this->setForm();
     $this->tpl->set_var("uname", $this->user["uname"]);
     $this->tpl->set_var("today", date("F j, Y"));
     $this->setPageDetailPerms();
     $this->tpl->set_var("Session", $this->sess->url(""));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
开发者ID:armic,项目名称:erpts,代码行数:33,代码来源:ConsolidatedQuarterlyReportOnRPTCollections.php

示例3: parseSource

 /**
  * Main parser dispatcher method.
  * This is where the first-level parsing gets dispatched to specific parser methods.
  * Accepts (requires) a single string, containing HTML to be parsed for uFormats.
  * Returns an xArray of parsed uFormats' objects.
  * @param $str HTML to be parsed.
  * @return xArray of uFormat objects.
  */
 function parseSource($str)
 {
     @($this->_dom =& domxml_open_mem($str));
     if (!$this->_dom) {
         return false;
     }
     $root = $this->_dom->get_elements_by_tagname('body');
     $root = $root[0];
     $children = $root->child_nodes();
     $elems = new xArray();
     foreach ($children as $child) {
         if ($this->_parseHCard) {
             $e = $this->parseCard($child);
             $elems->append($e->toArray());
         }
         if ($this->_parseHCalendar) {
             $e = $this->parseCalendar($child);
             $elems->append($e->toArray());
         }
         if ($this->_parseHReview) {
             $e = $this->parseReview($child);
             $elems->append($e->toArray());
         }
         if ($this->_parseRelTags) {
             $e = $this->parseRel($child);
             $elems->append($e->toArray());
         }
     }
     return $elems->compact();
 }
开发者ID:anubhaBhargava,项目名称:OpenRecommender,代码行数:38,代码来源:MicroFormatParser.php

示例4: parseDomDocument

 function parseDomDocument($domDoc)
 {
     $baseNode = $domDoc->document_element();
     // IF statement for bug fix of December 04, 2003
     // when an error occured on a blank FAAS list
     if (!is_object($baseNode)) {
         return false;
     }
     if ($baseNode->has_child_nodes()) {
         $child = $baseNode->first_child();
         while ($child) {
             //if ($child->tagname=="OD") {
             if ($child->tagname) {
                 $tempXmlStr = $domDoc->dump_node($child);
                 $tempDomDoc = domxml_open_mem($tempXmlStr);
                 $od = new OD();
                 if ($od->parseDomDocument($tempDomDoc)) {
                     $this->arrayList[] = $od;
                 }
             }
             $child = $child->next_sibling();
         }
     }
     $ret = $this->setDomDocument() ? true : false;
     return $ret;
 }
开发者ID:armic,项目名称:erpts,代码行数:26,代码来源:ODRecords.php

示例5: _testXPath

 /**
  * AkTestApplication->_testXPath()
  *
  * @author Bermi Ferrer Martinez
  * @license LGPL
  */
 public function _testXPath($xpath_expression)
 {
     if (false === class_exists('DOMDocument') or false === class_exists('DOMXPath')) {
         if (function_exists('domxml_open_mem') === true) {
             $dom = domxml_open_mem($this->_response);
             if (false === $dom) {
                 $this->fail('Error parsing the document.');
                 return false;
             }
             #var_dump($dom);
             $xpath = $dom->xpath_init();
             #var_dump($xpath);
             $ctx = $dom->xpath_new_context();
             #var_dump($xpath_expression);
             $result = $ctx->xpath_eval($xpath_expression);
             #var_dump($result);
             $return = new stdClass();
             $return->length = count($result->nodeset);
             return $return;
         }
         $this->fail('No xpath support built in.');
         return false;
     } elseif (extension_loaded('domxml')) {
         $this->fail('Please disable the domxml extension. Only php5 builtin domxml is supported');
         return false;
     }
     $dom = new DOMDocument();
     $response = preg_replace('/(<!DOCTYPE.*?>)/is', '', $this->_response);
     $dom->loadHtml($response);
     $xpath = new DOMXPath($dom);
     $node = $xpath->query($xpath_expression);
     return $node;
 }
开发者ID:Clansuite,项目名称:Clansuite,代码行数:39,代码来源:unittester.php

示例6: initBarangayList

 function initBarangayList()
 {
     $this->tpl->set_block("rptsTemplate", "BarangayList", "BarangayListBlock");
     $BarangayList = new SoapObject(NCCBIZ . "BarangayList.php", "urn:Object");
     if (!($xmlStr = $BarangayList->getBarangayList(0, " WHERE " . BARANGAY_TABLE . ".status='active' ORDER BY description"))) {
         $this->tpl->set_var("barangayID", "");
         $this->tpl->set_var("barangay", "empty barangay list");
         $this->tpl->parse("BarangayListBlock", "BarangayList", true);
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_var("barangayID", "");
             $this->tpl->set_var("barangay", "empty barangay list");
             $this->tpl->parse("BarangayListBlock", "BarangayList", true);
         } else {
             $barangayRecords = new BarangayRecords();
             $barangayRecords->parseDomDocument($domDoc);
             if (is_array($barangayRecords->arrayList)) {
                 foreach ($barangayRecords->arrayList as $key => $value) {
                     $this->tpl->set_var("barangayID", $value->getBarangayID());
                     $this->tpl->set_var("barangay", $value->getDescription());
                     $this->tpl->parse("BarangayListBlock", "BarangayList", true);
                 }
             }
         }
     }
 }
开发者ID:armic,项目名称:erpts,代码行数:26,代码来源:GeneralRevision.php

示例7: Main

 function Main($referer = "")
 {
     if (!$referer || !isset($referer)) {
         $referer = "OwnerList.php";
     }
     $this->tpl->set_var("referer", $referer);
     switch ($this->formArray["formAction"]) {
         case "save" || "view" || "viewOnly":
             $this->tpl->set_var("referer", $referer);
             $CompanyDetails = new SoapObject(NCCBIZ . "CompanyDetails.php", "urn:Object");
             if (!($xmlStr = $CompanyDetails->getCompanyDetails($this->formArray["companyID"]))) {
                 $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                 $this->tpl->set_var("TableBlock", "record not found");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
                     $this->tpl->set_var("TableBlock", "error xmlDoc");
                 } else {
                     $company = new Company();
                     $company->parseDomDocument($domDoc);
                     $this->formArray["companyID"] = $company->getCompanyID();
                     $this->formArray["companyName"] = $company->getCompanyName();
                     $this->formArray["tin"] = $company->getTin();
                     $this->formArray["telephone"] = $company->getTelephone();
                     $this->formArray["fax"] = $company->getFax();
                     $address = $company->addressArray[0];
                     if (is_a($address, Address)) {
                         $this->formArray["addressID"] = $address->getAddressID();
                         $this->formArray["number"] = $address->getNumber();
                         $this->formArray["street"] = $address->getStreet();
                         $this->formArray["barangay"] = $address->getBarangay();
                         $this->formArray["district"] = $address->getDistrict();
                         $this->formArray["municipalityCity"] = $address->getMunicipalitycity();
                         $this->formArray["province"] = $address->getProvince();
                     }
                     $this->formArray["email"] = $company->getEmail();
                     $this->formArray["website"] = $company->getWebsite();
                 }
             }
             if ($this->formArray["formAction"] == "viewOnly") {
                 $this->tpl->set_block("rptsTemplate", "ViewOnly", "ViewOnlyBlock");
                 $this->tpl->set_var("ViewOnlyBlock", "");
             }
             break;
         case "cancel":
             //header("location: CompanyList.php");
             exit;
             break;
         default:
             $this->tpl->set_block("rptsTemplate", "ACK", "ACKBlock");
             $this->tpl->set_var("ACKBlock", "");
     }
     //*/
     $this->setForm();
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
开发者ID:armic,项目名称:erpts,代码行数:58,代码来源:CompanyDetails.php

示例8: votable_parse_text

function votable_parse_text($result)
{
    $xml = domxml_open_mem($result);
    if (!$xml) {
        return "XML parsing error";
    }
    $s = "";
    // root: votable
    $n = $xml->document_element();
    // definitions
    $n = $n->first_child();
    // resource
    $n = $n->next_sibling();
    // description
    $n = $n->first_child();
    // table
    $n = $n->next_sibling();
    // fields
    $n = $n->first_child();
    while ($n->node_name() == 'FIELD') {
        $s .= $n->get_attribute("name");
        $s .= "\t";
        $n = $n->next_sibling();
    }
    $s .= "\r\n";
    // data
    // tabledata
    $n = $n->first_child();
    // tr
    $r = $n->first_child();
    while ($r) {
        if ($r->node_name() == 'TR') {
            $f = $r->first_child();
            while ($f) {
                // td
                if ($f->node_name() == 'TD') {
                    $v = $f->first_child();
                    if ($v) {
                        $v2 = $v->node_value();
                        if ($v2 == "t") {
                            $v2 = "TRUE";
                        }
                        if ($v2 == "f") {
                            $v2 = "FALSE";
                        }
                        $s .= $v2 . "\t";
                    } else {
                        $s .= "\t";
                    }
                }
                $f = $f->next_sibling();
            }
            $s .= "\r\n";
        }
        $r = $r->next_sibling();
    }
    return $s;
}
开发者ID:helio-vo,项目名称:helio,代码行数:58,代码来源:sec_votable.php

示例9: Main

 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "delete":
             if (count($this->formArray["propAssessKindsID"]) > 0) {
                 $PropAssessKindsList = new SoapObject(NCCBIZ . "PropAssessKindsList.php", "urn:Object");
                 if (!($deletedRows = $PropAssessKindsList->deletePropAssessKinds($this->formArray["propAssessKindsID"]))) {
                     $this->tpl->set_var("msg", "SOAP failed");
                 } else {
                     $this->tpl->set_var("msg", $deletedRows . " records deleted");
                 }
             } else {
                 $this->tpl->set_var("msg", "0 records deleted");
             }
             break;
         case "activate":
             $PropAssessKindsList = new SoapObject(NCCBIZ . "PropAssessKindsList.php", "urn:Object");
             if (!($activeRows = $PropAssessKindsList->updateStatus($this->formArray["status"]))) {
                 $this->tpl->set_var("msg", "All records have status made <i>inactive</i>");
             } else {
                 $this->tpl->set_var("msg", $activeRows . " records have status made <i>active</i>");
             }
             break;
         case "cancel":
             header("location: PropAssessKindsList.php");
             exit;
             break;
         default:
             $this->tpl->set_var("msg", "");
     }
     $PropAssessKindsList = new SoapObject(NCCBIZ . "PropAssessKindsList.php", "urn:Object");
     if (!($xmlStr = $PropAssessKindsList->getPropAssessKindsList())) {
         $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
         $this->tpl->set_var("TableBlock", "database is empty");
     } else {
         if (!($domDoc = domxml_open_mem($xmlStr))) {
             $this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
             $this->tpl->set_var("TableBlock", "error xmlDoc");
         } else {
             $propAssessKindsRecords = new PropAssessKindsRecords();
             $propAssessKindsRecords->parseDomDocument($domDoc);
             $list = $propAssessKindsRecords->getArrayList();
             $this->tpl->set_block("rptsTemplate", "PropAssessKindsList", "PropAssessKindsListBlock");
             foreach ($list as $key => $listValue) {
                 $this->tpl->set_var("propAssessKindsID", $listValue->getPropAssessKindsID());
                 $this->tpl->set_var("code", $listValue->getCode());
                 $this->tpl->set_var("description", $listValue->getDescription());
                 $this->tpl->set_var("value", $listValue->getValue());
                 $this->tpl->set_var("status", $listValue->getStatus());
                 $this->tpl->set_var("statusCheck", $this->getStatusCheck($listValue->getStatus()));
                 $this->tpl->parse("PropAssessKindsListBlock", "PropAssessKindsList", true);
             }
         }
     }
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
开发者ID:armic,项目名称:erpts,代码行数:58,代码来源:PropAssessKindsList.php

示例10: Main

 function Main()
 {
     switch ($this->formArray["formAction"]) {
         case "save":
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
                 exit("error xml");
             } else {
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     exit("error domDoc");
                 } else {
                     $AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
                     $afs = new AFS();
                     $afs->parseDomDocument($domDoc);
                     $afs->setArpNumber($this->formArray["arpNumber"]);
                     $afs->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
                     $afs->setTaxability($this->formArray["taxability"]);
                     $afs->setEffectivity($this->formArray["effectivity"]);
                     $afs->setDomDocument();
                     $doc = $afs->getDomDocument();
                     $xmlStr = $doc->dump_mem(true);
                     if (!($ret = $AFSEncode->updateAFS($xmlStr))) {
                         exit("error update");
                     }
                 }
             }
             header("location: RPUIdentificationClose.php" . $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
             exit;
             break;
         default:
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             $AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
             if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
                 exit("error xml");
             } else {
                 //echo $xmlStr;
                 if (!($domDoc = domxml_open_mem($xmlStr))) {
                     exit("error domDoc");
                 } else {
                     $afs = new AFS();
                     $afs->parseDomDocument($domDoc);
                     $this->formArray["afsID"] = $afs->getAfsID();
                     $this->formArray["arpNumber"] = $afs->getArpNumber();
                     $this->formArray["taxability"] = $afs->getTaxability();
                     $this->formArray["effectivity"] = $afs->getEffectivity();
                     $this->formArray["propertyIndexNumber"] = $afs->getPropertyIndexNumber();
                 }
             }
             break;
     }
     $this->setForm();
     $this->tpl->set_var("Session", $this->sess->url("") . $this->sess->add_query(array("afsID" => $this->formArray["afsID"])));
     $this->tpl->parse("templatePage", "rptsTemplate");
     $this->tpl->finish("templatePage");
     $this->tpl->p("templatePage");
 }
开发者ID:armic,项目名称:erpts,代码行数:56,代码来源:RPUIdentificationEncode.php

示例11: updateDue

 function updateDue($xmlStr)
 {
     if (!($domDoc = domxml_open_mem($xmlStr))) {
         return false;
     }
     $due = new Due();
     $due->parseDomDocument($domDoc);
     $ret = $due->updateRecord();
     return $ret;
 }
开发者ID:armic,项目名称:erpts,代码行数:10,代码来源:DueEncode.php

示例12: updateLandSubclasses

 function updateLandSubclasses($xmlStr)
 {
     if (!($domDoc = domxml_open_mem($xmlStr))) {
         return false;
     }
     $landSubclasses = new LandSubclasses();
     $landSubclasses->parseDomDocument($domDoc);
     $ret = $landSubclasses->updateRecord();
     return $ret;
 }
开发者ID:armic,项目名称:erpts,代码行数:10,代码来源:LandSubclassesEncode.php

示例13: updateMachineriesDepreciation

 function updateMachineriesDepreciation($xmlStr)
 {
     if (!($domDoc = domxml_open_mem($xmlStr))) {
         return false;
     }
     $machineriesDepreciation = new MachineriesDepreciation();
     $machineriesDepreciation->parseDomDocument($domDoc);
     $ret = $machineriesDepreciation->updateRecord();
     return $ret;
 }
开发者ID:armic,项目名称:erpts,代码行数:10,代码来源:MachineriesDepreciationEncode.php

示例14: updatePropAssessKinds

 function updatePropAssessKinds($xmlStr)
 {
     if (!($domDoc = domxml_open_mem($xmlStr))) {
         return false;
     }
     $propAssessKinds = new PropAssessKinds();
     $propAssessKinds->parseDomDocument($domDoc);
     $ret = $propAssessKinds->updateRecord();
     return $ret;
 }
开发者ID:armic,项目名称:erpts,代码行数:10,代码来源:PropAssessKindsEncode.php

示例15: updateCollection

 function updateCollection($xmlStr)
 {
     if (!($domDoc = domxml_open_mem($xmlStr))) {
         return false;
     }
     $collection = new Collection();
     $collection->parseDomDocument($domDoc);
     $ret = $collection->updateRecord();
     return $ret;
 }
开发者ID:armic,项目名称:erpts,代码行数:10,代码来源:CollectionEncode.php


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