本文整理汇总了PHP中XMLWriter::endDTD方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLWriter::endDTD方法的具体用法?PHP XMLWriter::endDTD怎么用?PHP XMLWriter::endDTD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XMLWriter
的用法示例。
在下文中一共展示了XMLWriter::endDTD方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: XMLWriter
<?php
const N = "test.xml";
$xmlw = new XMLWriter(N);
$xmlw->openURI(N);
$xmlw->startDTD("xml");
$xmlw->endDTD();
$xmlw->setIndent(1);
for ($i = 0; $i < 5; $i++) {
$xmlw->startElement("user");
$xmlw->startElement("name");
$xmlw->text(rand(100, 900));
$xmlw->endElement();
$xmlw->startElement("password");
$xmlw->text(md5(uniqid()));
$xmlw->endElement();
$xmlw->endElement();
}
echo $xmlw->outputMemory();
示例2: html
public function html()
{
$uri = sprintf("http://%s/api/soap", $_SERVER['HTTP_HOST']);
$html = new XMLWriter();
$html->openMemory();
$html->setIndent(TRUE);
$html->startDTD('html', '-//W3C//DTD XHTML 1.0 Strict//EN', 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
// standards compliant
$html->endDTD();
$html->startElement('html');
$html->writeAttribute('xmlns', 'http://www.w3.org/1999/xhtml');
$html->startElement('head');
$html->writeElement('title', sprintf('%s Soap Definition', $this->name));
$html->endElement();
//head
$html->startElement('body');
$html->writeElement('h1', sprintf('%s Soap Definition', $this->name));
$html->startElement('p');
$html->startElement('a');
$html->writeAttribute('href', "{$uri}/?wsdl");
$html->text('WSDL');
$html->endElement();
//p
$html->endElement();
//p
foreach ($this->oper as $o) {
$html->writeElement('h2', "{$o} (");
$html->startElement('p');
foreach ($this->msgs[$o] as $p) {
$html->startElement('blockquote');
$html->writeElement('code', $p->name);
$html->writeElement('i', 'as');
$html->writeElement('i', $p->type);
$html->endElement();
}
$html->text(') {');
$html->writeElement('br');
$html->startElement('blockquote');
$html->text(' ...');
$html->writeElement('br');
$html->writeElement('b', $this->rets[$o]->name);
$html->writeElement('i', 'as');
$html->writeElement('i', $this->rets[$o]->type);
$html->endElement();
$html->text('}');
$html->endElement();
//p
}
$html->writeElement('style', '
code {
color: blue;
}
');
$html->endElement();
//body
$html->endElement();
//html
header('Content-type: application/xhtml+xml; charset=UTF-8');
echo $html->outputMemory(TRUE);
}