當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DomDocument::CreateElement方法代碼示例

本文整理匯總了PHP中DomDocument::CreateElement方法的典型用法代碼示例。如果您正苦於以下問題:PHP DomDocument::CreateElement方法的具體用法?PHP DomDocument::CreateElement怎麽用?PHP DomDocument::CreateElement使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DomDocument的用法示例。


在下文中一共展示了DomDocument::CreateElement方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ToXML

 public function ToXML()
 {
     $xmlRebill = new DomDocument('1.0');
     $nodeRoot = $xmlRebill->CreateElement('RebillUpload');
     $nodeRoot = $xmlRebill->appendChild($nodeRoot);
     $nodeNewRebill = $xmlRebill->createElement('NewRebill');
     $nodeNewRebill = $nodeRoot->appendChild($nodeNewRebill);
     $nodeCustomer = $xmlRebill->createElement('eWayCustomerID');
     $nodeCustomer = $nodeNewRebill->appendChild($nodeCustomer);
     $value = $xmlRebill->createTextNode($this->m_ewayCustomerID);
     $value = $nodeCustomer->appendChild($value);
     //Customer
     $nodeCustomer = $xmlRebill->createElement('Customer');
     $nodeCustomer = $nodeNewRebill->appendChild($nodeCustomer);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerRef');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerRef);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerTitle');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerTitle);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerFirstName');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerFirstName);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerLastName');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerLastName);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerCompany');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerCompany);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerJobDesc');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerJobDesc);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerEmail');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerEmail);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerAddress');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerAddress);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerSuburb');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerSuburb);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerState');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerState);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerPostCode');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerPostCode);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerCountry');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerCountry);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerPhone1');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerPhone1);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerPhone2');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerPhone2);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerFax');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerFax);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerURL');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerURL);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerComments');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerComments);
     $value = $nodeCustomerDetails->appendChild($value);
     //Rebill Events
     $nodeRebillEvent = $xmlRebill->createElement('RebillEvent');
     $nodeRebillEvent = $nodeNewRebill->appendChild($nodeRebillEvent);
     $nodeRebillDetails = $xmlRebill->createElement('RebillInvRef');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillInvRef);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillInvDesc');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillInvDesc);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillCCName');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillCCName);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillCCNumber');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillCCNumber);
//.........這裏部分代碼省略.........
開發者ID:hornet9,項目名稱:Morato,代碼行數:101,代碼來源:RebillPayment.php


注:本文中的DomDocument::CreateElement方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。