コード例 #1
0
ファイル: Templator.php プロジェクト: noikiy/PHPStamp
 private function createTemplate(\DOMDocument $template, DocumentInterface $document)
 {
     // prepare xml document
     Processor::escapeXsl($template);
     $document->cleanup($template);
     // process prepared xml document
     Processor::wrapIntoTemplate($template);
     // find node list with text and handle tags
     $query = $document->getNodePath();
     $query .= sprintf('[contains(text(), "%s") and contains(text(), "%s")]', $this->brackets[0], $this->brackets[1]);
     $nodeList = XMLHelper::queryTemplate($template, $query);
     $this->searchAndReplace($nodeList, $document);
 }