本文整理汇总了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);
//.........这里部分代码省略.........