Ejemplo n.º 1
0
function FirstContact()
{
    global $db, $xmlout;
    $db->init_log(1);
    $time = localtime(time(), true);
    $VerifyID = $time['tm_min'] + $time['tm_sec'];
    $RecordID = $db->add_usage_record($VerifyID);
    $memory = xmlwriter_open_memory();
    xmlwriter_start_document($memory, '1.0', 'UTF-8');
    xmlwriter_write_dtd($memory, "AWB");
    xmlwriter_start_element($memory, "DB");
    xmlwriter_write_attribute($memory, "Record", $RecordID);
    xmlwriter_write_attribute($memory, "Verify", $VerifyID);
    xmlwriter_end_element($memory);
    $xmlout = xmlwriter_output_memory($memory, true);
}
<?php

$xmlwriter = xmlwriter_open_memory();
var_dump(xmlwriter_write_dtd($xmlwriter, 'bla1', 'bla2', 'bla3', 'bla4'));
$output = xmlwriter_flush($xmlwriter, true);
print $output . PHP_EOL;
var_dump(xmlwriter_write_dtd($xmlwriter, '', '', ''));
$output = xmlwriter_flush($xmlwriter, true);
print $output;
<?php

$xmlwriter = xmlwriter_open_memory();
var_dump(xmlwriter_write_dtd($xmlwriter));
Ejemplo n.º 4
0
VERIFY(xmlwriter_start_element($xml, "node"));
VERIFY(xmlwriter_start_cdata($xml));
VERIFY(xmlwriter_text($xml, "Raw text"));
VERIFY(xmlwriter_end_cdata($xml));
VERIFY(xmlwriter_end_element($xml));
VERIFY(xmlwriter_start_element($xml, "node"));
VERIFY(xmlwriter_write_cdata($xml, "More CDATA"));
VERIFY(xmlwriter_end_element($xml));
VERIFY(xmlwriter_start_comment($xml));
VERIFY(xmlwriter_text($xml, "Comments"));
VERIFY(xmlwriter_end_comment($xml));
VERIFY(xmlwriter_write_comment($xml, "More comments"));
VERIFY(xmlwriter_start_pi($xml, "lol"));
VERIFY(xmlwriter_end_pi($xml));
VERIFY(xmlwriter_write_pi($xml, "php", "print 'Hello world!';"));
VERIFY(xmlwriter_write_raw($xml, "<node>Raw XML</node>"));
VERIFY(xmlwriter_write_dtd($xml, "name", "publicID", "systemID", "subset"));
VERIFY(xmlwriter_start_dtd($xml, "name", "publicID", "systemID"));
VERIFY(xmlwriter_end_dtd($xml));
VERIFY(xmlwriter_start_dtd_element($xml, "name"));
VERIFY(xmlwriter_end_dtd_element($xml));
VERIFY(xmlwriter_write_dtd_element($xml, "name", "content"));
VERIFY(xmlwriter_start_dtd_attlist($xml, "name"));
VERIFY(xmlwriter_end_dtd_attlist($xml));
VERIFY(xmlwriter_write_dtd_attlist($xml, "name", "content"));
VERIFY(xmlwriter_start_dtd_entity($xml, "name", false));
VERIFY(xmlwriter_end_dtd_entity($xml));
VERIFY(xmlwriter_write_dtd_entity($xml, "name", "content", false, "publicid", "systemid", "ndataid"));
VERIFY(xmlwriter_end_document($xml));
var_dump(xmlwriter_flush($xml));
var_dump(xmlwriter_output_memory($xml));