• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP DOMImplementation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: exportCoursesToXML

 public function exportCoursesToXML()
 {
     $imp = new DOMImplementation();
     $dtd = $imp->createDocumentType('kurse', '', 'http://dl.dropbox.com/u/357576/saves/dtd/course.dtd');
     $doc = $imp->createDocument('', '', $dtd);
     $doc->formatOutput = true;
     $doc->encoding = "utf-8";
     $doc->version = "1.0";
     $pi = $doc->createProcessingInstruction("xml-stylesheet", "type=\"text/css\" href=\"http://dl.dropbox.com/u/357576/saves/dtd/course.css\"");
     $doc->appendChild($pi);
     $r = $doc->createElement("kurse");
     $doc->appendChild($r);
     $courses = $this->db->model('kurse')->select()->execute()->result;
     foreach ($courses as $course) {
         $k = $doc->createElement("kurs");
         $course_id = $doc->createElement("kursId");
         $course_id->appendChild($doc->createTextNode($course['id']));
         $k->appendChild($course_id);
         $course_name = $doc->createElement("kursname");
         $course_name->appendChild($doc->createTextNode($course['kursname']));
         $k->appendChild($course_name);
         $semester = $doc->createElement("semester");
         $semester->appendChild($doc->createTextNode($course['semester']));
         $k->appendChild($semester);
         $r->appendChild($k);
     }
     return $doc->saveXML();
 }
开发者ID:hhessel,项目名称:rfh_praxisseminar2,代码行数:28,代码来源:Exporter.php


示例2: __invoke

 /**
  * Array to XML markup.
  *
  * @since 160829.74007 XML conversion utils.
  *
  * @param string $parent_element_name Parent element name.
  * @param array  $array               Input array to convert.
  * @param array  $args                Any additional behavioral args.
  *
  * @return string XML or HTML (with or w/o a DOCTYPE tag).
  *
  * @note `<!DOCTYPE html>` is an HTML DOCTYPE tag.
  * @note `<?xml version="1.0" encoding="utf-8"?>` is an XML DOCTYPE tag.
  */
 public function __invoke(string $parent_element_name, array $array, array $args = []) : string
 {
     $default_args = ['type' => 'xml', 'version' => '1.0', 'encoding' => 'utf-8', 'include_doctype' => true, 'format' => true];
     $args += $default_args;
     // Merge w/ defaults.
     $args['type'] = (string) $args['type'];
     $args['version'] = (string) $args['version'];
     $args['encoding'] = (string) $args['encoding'];
     $args['include_doctype'] = (bool) $args['include_doctype'];
     $args['format'] = (bool) $args['format'];
     if ($args['type'] === 'html') {
         $DOMImplementation = new \DOMImplementation();
         $DOMDocumentType = $DOMImplementation->createDocumentType($args['type']);
         $DOMDocument = $DOMImplementation->createDocument('', '', $DOMDocumentType);
     } else {
         $DOMDocument = new \DOMDocument($args['version']);
     }
     $DOMDocument->encoding = $args['encoding'];
     $DOMDocument->formatOutput = $args['format'];
     // Indentation.
     $save = $args['type'] === 'html' ? 'saveHTML' : 'saveXML';
     $ParentDOMElement = $DOMDocument->createElement($parent_element_name);
     $DOMDocument->appendChild($ParentDOMElement);
     $this->convert($DOMDocument, $ParentDOMElement, $array);
     if (!$args['include_doctype']) {
         return (string) $DOMDocument->{$save}($DOMDocument->documentElement);
     } else {
         return (string) $DOMDocument->{$save}();
         // With doctype.
     }
 }
开发者ID:websharks,项目名称:core,代码行数:45,代码来源:Array2Xml.php


示例3: getResponse

 /**
  * create the response
  *
  * @return DOMDocument
  */
 public function getResponse()
 {
     // Creates an instance of the DOMImplementation class
     $imp = new DOMImplementation();
     // Creates a DOMDocument instance
     $document = $imp->createDocument("http://schemas.microsoft.com/exchange/autodiscover/mobilesync/requestschema/2006", 'Autodiscover');
     $document->xmlVersion = '1.0';
     $document->encoding = 'UTF-8';
     $document->formatOutput = false;
     $response = $document->documentElement->appendChild($document->createElement('Response'));
     $user = $response->appendChild($document->createElement('User'));
     $user->appendChild($document->createElement('EMailAddress', $this->emailAddress));
     $settings = $document->createElement('Settings');
     if (!empty($this->mobileSyncUrl)) {
         $server = $document->createElement('Server');
         $server->appendChild($document->createElement('Type', 'MobileSync'));
         $server->appendChild($document->createElement('Url', $this->mobileSyncUrl));
         $server->appendChild($document->createElement('Name', $this->mobileSyncUrl));
         $settings->appendChild($server);
     }
     if (!empty($this->certEnrollUrl)) {
         $server = $document->createElement('Server');
         $server->appendChild($document->createElement('Type', 'CertEnroll'));
         $server->appendChild($document->createElement('Url', $this->certEnrollUrl));
         $server->appendChild($document->createElement('Name'));
         $server->appendChild($document->createElement('ServerData', 'CertEnrollTemplate'));
         $settings->appendChild($server);
     }
     if ($settings->hasChildNodes()) {
         $action = $response->appendChild($document->createElement('Action'));
         $action->appendChild($settings);
     }
     return $document;
 }
开发者ID:malamalca,项目名称:lil-activesync,代码行数:39,代码来源:AutoDiscover.php


示例4: toXmlString

 public function toXmlString()
 {
     $impl = new DOMImplementation();
     $docTypeName = 'uBookMessage';
     $docTypePublic = '-//uBook/DTD uBookMessage 1//EN';
     $docTypeId = WEBDIR . 'uBookMessage.dtd';
     $docType = $impl->createDocumentType($docTypeName, $docTypePublic, $docTypeId);
     $doc = $impl->createDocument('', '', $docType);
     $doc->encoding = 'UTF-8';
     $doc->xmlStandalone = false;
     $message = $doc->createElement('uBookMessage');
     $message->setAttribute('version', '1');
     $message->setAttribute('from', $this->from);
     $doc->appendChild($message);
     foreach ($this->bookList as $i => $b) {
         $book = $doc->createElement('book');
         $book->setAttribute('url', $b->getUrl());
         $book->setAttribute('author', $b->getAuthor());
         $book->setAttribute('title', $b->getTitle());
         $book->setAttribute('price', $b->getPrice());
         $message->appendChild($book);
     }
     foreach ($this->servers as $i => $s) {
         $server = $doc->createElement('server');
         $server->setAttribute('url', $s->getUrl());
         $message->appendChild($server);
     }
     $doc->formatOutput = true;
     return $doc->saveXML();
 }
开发者ID:BackupTheBerlios,项目名称:ubook-svn,代码行数:30,代码来源:Message.php


示例5: toDOMDocument

 /**
  * @return \DOMDocument
  */
 public function toDOMDocument()
 {
     $implementation = new \DOMImplementation();
     $dtd = $implementation->createDocumentType('root', null, 'https://www.sode.pl/sode.dtd');
     $dom = $implementation->createDocument('', '', $dtd);
     $root = $dom->createElement('root');
     $properties = $dom->importNode($this->getProperties()->toDOMElement(), true);
     $client = $dom->importNode($this->getClient()->toDOMElementWithAttributes(), true);
     $document = $dom->createElement('document');
     $document->setAttribute('type', $this->getType());
     $document->setAttribute('label', $this->getLabel());
     $document->setAttribute('label_name', $this->getLabelName());
     $document->setAttribute('notify', $this->getNotify());
     $document->setAttribute('paid', $this->getPaid() ? 1 : 0);
     $root->appendChild($document);
     $document->appendChild($properties);
     $document->appendChild($client);
     $elements = $dom->createElement('elements');
     foreach ($this->elements as $element) {
         $elements->appendChild($dom->importNode($element->toDOMElement(), true));
     }
     if ($this->getAutoTotalEntry()) {
         $elements->appendChild($dom->importNode($this->getTotalElement()->toDOMElement(), true));
     }
     $document->appendChild($elements);
     $dom->formatOutput = true;
     $dom->appendChild($root);
     return $dom;
 }
开发者ID:finalclass,项目名称:netcore,代码行数:32,代码来源:Document.php


示例6: DOMImplementation

 /**
  * Create a new XML document.
  * If $url is set, the DOCTYPE definition is treated as a PUBLIC
  * definition; $dtd should contain the ID, and $url should contain the
  * URL. Otherwise, $dtd should be the DTD name.
  */
 function &createDocument($type = null, $dtd = null, $url = null)
 {
     $version = '1.0';
     if (class_exists('DOMImplementation')) {
         // Use the new (PHP 5.x) DOM
         $impl = new DOMImplementation();
         // only generate a DOCTYPE if type is non-empty
         if ($type != '') {
             $domdtd = $impl->createDocumentType($type, isset($url) ? $dtd : '', isset($url) ? $url : $dtd);
             $doc = $impl->createDocument($version, '', $domdtd);
         } else {
             $doc = $impl->createDocument($version, '');
         }
         // ensure we are outputting UTF-8
         $doc->encoding = 'UTF-8';
     } else {
         // Use the XMLNode class
         $doc = new XMLNode();
         $doc->setAttribute('version', $version);
         if ($type !== null) {
             $doc->setAttribute('type', $type);
         }
         if ($dtd !== null) {
             $doc->setAttribute('dtd', $dtd);
         }
         if ($url !== null) {
             $doc->setAttribute('url', $url);
         }
     }
     return $doc;
 }
开发者ID:master3395,项目名称:CBPPlatform,代码行数:37,代码来源:XMLCustomWriter.inc.php


示例7: getPlistString

 public static function getPlistString($ipa, $bundleIdentifier, $version, $title)
 {
     $imp = new \DOMImplementation();
     $dtd = $imp->createDocumentType("plist", "-//Apple//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd");
     $dom = $imp->createDocument("", "", $dtd);
     $dom->encoding = "UTF-8";
     $dom->formatOutput = true;
     $dom->appendChild($element = $dom->createElement('plist'));
     $element->setAttribute('version', '1.0');
     $element->appendChild($dict = $dom->createElement('dict'));
     $dict->appendChild($dom->createElement('key', 'items'));
     $dict->appendChild($array = $dom->createElement('array'));
     $array->appendChild($mainDict = $dom->createElement('dict'));
     $mainDict->appendChild($dom->createElement('key', 'assets'));
     $mainDict->appendChild($array = $dom->createElement('array'));
     $array->appendChild($dict = $dom->createElement('dict'));
     $dict->appendChild($dom->createElement('key', 'kind'));
     $dict->appendChild($dom->createElement('string', 'software-package'));
     $dict->appendChild($dom->createElement('key', 'url'));
     $dict->appendChild($dom->createElement('string', $ipa));
     $mainDict->appendChild($dom->createElement('key', 'metadata'));
     $mainDict->appendChild($dict = $dom->createElement('dict'));
     $dict->appendChild($dom->createElement('key', 'bundle-identifier'));
     $dict->appendChild($dom->createElement('string', $bundleIdentifier));
     $dict->appendChild($dom->createElement('key', 'bundle-version'));
     $dict->appendChild($dom->createElement('string', $version));
     $dict->appendChild($dom->createElement('key', 'kind'));
     $dict->appendChild($dom->createElement('string', 'software'));
     $dict->appendChild($dom->createElement('key', 'title'));
     $dict->appendChild($titleElement = $dom->createElement('string'));
     $titleElement->appendChild($dom->createTextNode($title . '-v.' . $version));
     return $dom->saveXML();
 }
开发者ID:sanyaade-mobiledev,项目名称:apps-server,代码行数:33,代码来源:Helper.php


示例8: testAppendXmlData

 /**
  * test xml generation for IPhone
  *
  * birthday must have 12 hours added
  */
 public function testAppendXmlData()
 {
     $imp = new DOMImplementation();
     $dtd = $imp->createDocumentType('AirSync', "-//AIRSYNC//DTD AirSync//EN", "http://www.microsoft.com/");
     $testDoc = $imp->createDocument('uri:AirSync', 'Sync', $dtd);
     $testDoc->formatOutput = true;
     $testDoc->encoding = 'utf-8';
     $appData = $testDoc->documentElement->appendChild($testDoc->createElementNS('uri:AirSync', 'ApplicationData'));
     $email = new Syncroton_Model_FileReference(array('contentType' => 'text/plain', 'data' => 'Lars'));
     $email->appendXML($appData, $this->_testDevice);
     #echo $testDoc->saveXML();
     $xpath = new DomXPath($testDoc);
     $xpath->registerNamespace('AirSync', 'uri:AirSync');
     $xpath->registerNamespace('AirSyncBase', 'uri:AirSyncBase');
     $xpath->registerNamespace('Email', 'uri:Email');
     $xpath->registerNamespace('Email2', 'uri:Email2');
     $nodes = $xpath->query('//AirSync:Sync/AirSync:ApplicationData/AirSyncBase:ContentType');
     $this->assertEquals(1, $nodes->length, $testDoc->saveXML());
     $this->assertEquals('text/plain', $nodes->item(0)->nodeValue, $testDoc->saveXML());
     $nodes = $xpath->query('//AirSync:Sync/AirSync:ApplicationData/ItemOperations:Data');
     $this->assertEquals(1, $nodes->length, $testDoc->saveXML());
     $this->assertEquals('TGFycw==', $nodes->item(0)->nodeValue, $testDoc->saveXML());
     // try to encode XML until we have wbxml tests
     $outputStream = fopen("php://temp", 'r+');
     $encoder = new Syncroton_Wbxml_Encoder($outputStream, 'UTF-8', 3);
     $encoder->encode($testDoc);
 }
开发者ID:malamalca,项目名称:lil-activesync,代码行数:32,代码来源:FileReferenceTest.php


示例9: __construct

 /**
  * Constructor
  *
  * @param HTMLTree $tree
  */
 public function __construct(HTMLTree $tree)
 {
     $this->_tree = $tree;
     $dom_implementation = new \DOMImplementation();
     $doc_type = $dom_implementation->createDocumentType('html', '', '');
     $this->_dom = $dom_implementation->createDocument('', 'html', $doc_type);
     $this->_dom->documentElement->setAttribute('lang', 'en');
 }
开发者ID:hollodotme,项目名称:treemdown,代码行数:13,代码来源:HTMLPage.php


示例10: doctype

 public static function doctype($docid, $object = false)
 {
     $doctypes = array(self::HTML_4_STR => array("HTML", "-//W3C//DTD HTML 4.01//EN", "http://www.w3.org/TR/html4/strict.dtd"), self::HTML_4_TRA => array("HTML", "-//W3C//DTD HTML 4.01 Transitional//EN", "http://www.w3.org/TR/html4/loose.dtd"), self::HTML_4_FRA => array("HTML", "-//W3C//DTD HTML 4.01 Frameset//EN", "http://www.w3.org/TR/html4/frameset.dtd"), self::XHTML_1_STR => array("HTML", "-//W3C//DTD XHTML 1.0 Strict//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"), self::XHTML_1_TRA => array("HTML", "-//W3C//DTD XHTML 1.0 Transitional//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"), self::XHTML_1_FRA => array("HTML", "-//W3C//DTD XHTML 1.0 Frameset//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"), self::XHTML_1_1 => array("HTML", "-//W3C//DTD XHTML 1.1//EN", "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"), self::XHTML_1_BASIC => array("HTML", "-//W3C//DTD XHTML Basic 1.1//EN", "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd"), self::HTML_5 => array("HTML", "", ""), self::MATHML_1 => array("MATH", "", "http://www.w3.org/Math/DTD/mathml1/mathml.dtd"), self::MATHML_2 => array("MATH", "-//W3C//DTD MathML 2.0//EN", "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd"));
     $implementation = new \DOMImplementation();
     $dtd = $implementation->createDocumentType($doctypes[$docid][0], $doctypes[$docid][1], $doctypes[$docid][2]);
     $document = $implementation->createDocument('', '', $dtd);
     return $object ? $document : $document->saveHTML();
 }
开发者ID:charlesjohannisen,项目名称:nise.php,代码行数:8,代码来源:HTML.php


示例11: __construct

 /**
  * init your xhtml document.
  *
  * @access public
  * @return void
  */
 public function __construct()
 {
     $domImplementation = new DOMImplementation();
     $doctype = $domImplementation->createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
     $this->document = $domImplementation->createDocument('http://www.w3.org/1999/xhtml', 'html', $doctype);
     $this->head = $this->document->createElement('head');
     $this->body = $this->document->createElement('body');
     $this->setTitle(null);
     $this->setTitleAppend(null);
 }
开发者ID:BlackIkeEagle,项目名称:hersteldienst-devolder,代码行数:16,代码来源:XHtml.php


示例12: on_create

 protected function on_create()
 {
     $impl = new DOMImplementation();
     $dtd = $impl->createDocumentType('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
     $doc = $impl->createDocument($this->ccnamespaces[$this->rootns], null, $dtd);
     $doc->formatOutput = true;
     $doc->preserveWhiteSpace = true;
     $this->doc = $doc;
     parent::on_create();
 }
开发者ID:rolandovanegas,项目名称:moodle,代码行数:10,代码来源:cc_page.php


示例13: __construct

 function __construct($config)
 {
     $this->config = $config;
     $imp = new DOMImplementation();
     $dtd = $imp->createDocumentType('OPS_envelope', '', 'ops.dtd');
     $dom = $imp->createDocument("", "", $dtd);
     $dom->encoding = 'UTF-8';
     $dom->standalone = false;
     $this->xml = $dom;
 }
开发者ID:pcisneros,项目名称:glab-ci-ext,代码行数:10,代码来源:OpenSRS.php


示例14: initializeDocument

 /**
  * Initialize destination document
  * 
  * Initialize the structure which the destination document could be build
  * with. This may be an initial DOMDocument with some default elements, or
  * a string, or something else.
  *
  * @return mixed
  */
 protected function initializeDocument()
 {
     $imp = new DOMImplementation();
     $dtd = $imp->createDocumentType('article', '-//OASIS//DTD DocBook XML V4.5//EN', 'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd');
     $docbook = $imp->createDocument('http://docbook.org/ns/docbook', '', $dtd);
     $docbook->formatOutput = true;
     $root = $docbook->createElementNs('http://docbook.org/ns/docbook', 'article');
     $docbook->appendChild($root);
     return $root;
 }
开发者ID:jackalope,项目名称:jr_cr_demo,代码行数:19,代码来源:ezxml_docbook.php


示例15: createDomDocument

 public function createDomDocument()
 {
     $impl = new DOMImplementation();
     $dtd = $impl->createDocumentType('docman', '', get_server_url() . '/plugins/docman/docman-1.0.dtd');
     $doc = $impl->createDocument('', '', $dtd);
     $doc->encoding = 'UTF-8';
     $doc->standalone = 'no';
     $doc->version = '1.0';
     $doc->formatOutput = true;
     return $doc;
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:11,代码来源:XMLExport.class.php


示例16: __construct

 /**
  * Constructor
  *
  * @param RequestInterface $request Request
  * @param string $data Data
  * @throws InvalidResponseException if $data is empty
  */
 public function __construct(RequestInterface $request, $data)
 {
     $this->request = $request;
     if (empty($data)) {
         throw new InvalidResponseException();
     }
     $implementation = new \DOMImplementation();
     $responseDom = $implementation->createDocument();
     $responseDom->preserveWhiteSpace = false;
     $responseDom->loadXML($data);
     $this->data = simplexml_import_dom($responseDom->documentElement->firstChild);
 }
开发者ID:zerve,项目名称:omnipay-elementexpress,代码行数:19,代码来源:Response.php


示例17: createAttributes

 /** Build xml attributes from line data. See TicketLineInfo constructors. */
 private function createAttributes($product, $tax)
 {
     // Set xml
     $domimpl = new \DOMImplementation();
     $doctype = $domimpl->createDocumentType('properties', null, "http://java.sun.com/dtd/properties.dtd");
     $attrs = $domimpl->createDocument(null, null, $doctype);
     $attrs->encoding = "UTF-8";
     $attrs->version = "1.0";
     $attrs->standalone = false;
     // Add root properties element
     $properties = $attrs->createElement("properties");
     $attrs->appendChild($properties);
     // Add comment element
     $comment = $attrs->createElement("comment");
     $comment->appendChild($attrs->createTextNode("POS-Tech"));
     // This is actually the application name
     $properties->appendChild($comment);
     // Add some product keys
     $entry = $attrs->createElement("entry");
     $key = $attrs->createAttribute("key");
     $key->appendChild($attrs->createTextNode("product.taxcategoryid"));
     $entry->appendChild($key);
     $entry->appendChild($attrs->createTextNode($tax->taxCatId));
     $properties->appendChild($entry);
     $entry = $attrs->createElement("entry");
     $key = $attrs->createAttribute("key");
     $key->appendChild($attrs->createTextNode("product.com"));
     $entry->appendChild($key);
     $entry->appendChild($attrs->createTextNode("false"));
     // TODO add iscom field
     $properties->appendChild($entry);
     $entry = $attrs->createElement("entry");
     $key = $attrs->createAttribute("key");
     $key->appendChild($attrs->createTextNode("product.categoryid"));
     $entry->appendChild($key);
     $entry->appendChild($attrs->createTextNode($product->categoryId));
     $properties->appendChild($entry);
     $entry = $attrs->createElement("entry");
     $key = $attrs->createAttribute("key");
     $key->appendChild($attrs->createTextNode("product.scale"));
     $entry->appendChild($key);
     $entry->appendChild($attrs->createTextNode(strval($product->scaled) ? "true" : "false"));
     $properties->appendChild($entry);
     $entry = $attrs->createElement("entry");
     $key = $attrs->createAttribute("key");
     $key->appendChild($attrs->createTextNode("product.name"));
     $entry->appendChild($key);
     $entry->appendChild($attrs->createTextNode($product->label));
     $properties->appendChild($entry);
     // Save all this stuff
     $this->attributes = $attrs->saveXML();
 }
开发者ID:booko,项目名称:pasteque-server,代码行数:53,代码来源:TicketLine.php


示例18: __construct

 function __construct()
 {
     // Define HTTP Client
     $this->client = new Proxy_Request(null, array('useBrackets' => false));
     $this->client->setMethod(HTTP_REQUEST_METHOD_POST);
     $this->client->addHeader('Content-Type', 'text/xml');
     $this->client->setURL($configArray['NCIP']['url']);
     // Setup XML Messages
     $dom = new DOMImplementation();
     $doctype = $dom->createDocumentType('NCIPMessage', '-//NISO//NCIP DTD Version 1//EN', 'http://www.niso.org/ncip/v1_0/imp1/dtd/ncip_v1_0.dtd');
     $this->doc = $dom->createDocument('', '', $doctype);
     $this->doc->encoding = 'UTF-8';
     $this->doc->formatOutput = true;
     $this->agencyCode = $configArray['NCIP']['agencyId'];
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:15,代码来源:NCIP.php


示例19: visit

 /**
  * Docarate BBCode AST
  *
  * Visit the BBCode abstract syntax tree.
  *
  * @param ezcDocumentBBCodeDocumentNode $ast
  * @return mixed
  */
 public function visit(ezcDocumentBBCodeDocumentNode $ast)
 {
     // Create article from AST
     $imp = new DOMImplementation();
     $dtd = $imp->createDocumentType('article', '-//OASIS//DTD DocBook XML V4.5//EN', 'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd');
     $this->document = $imp->createDocument('http://docbook.org/ns/docbook', '', $dtd);
     $this->document->formatOutput = true;
     //        $root = $this->document->createElement( 'article' );
     $root = $this->document->createElementNs('http://docbook.org/ns/docbook', 'article');
     $this->document->appendChild($root);
     // Visit all childs of the AST root node.
     foreach ($ast->nodes as $node) {
         $this->visitNode($root, $node);
     }
     return $this->document;
 }
开发者ID:bmdevel,项目名称:ezc,代码行数:24,代码来源:docbook.php


示例20: __construct

 public function __construct($name = null, $public = null, $system = null)
 {
     /* DOMImplementation methods seem to be very fussy about how
      ** they are passed arguments. We do it this way to reduce errors and
      ** warnings that we don't need.
      */
     $impl = new DOMImplementation();
     if (is_null($name)) {
         $this->_dom = $impl->createDocument('', '');
     } else {
         $dtd = $impl->createDocumentType($name, $public, $system);
         $this->_dom = $impl->createDocument('', '', $dtd);
     }
     $this->elementClass();
     $this->_stack = array($this->_dom);
 }
开发者ID:nsandlin,项目名称:linepig,代码行数:16,代码来源:Document.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP DOMNode类代码示例发布时间:2022-05-23
下一篇:
PHP DOMElement类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap