/PHP-7.2/ext/xmlwriter/examples/ |
H A D | xmlwriter_file.php | 4 $xw = xmlwriter_open_uri('./a.xml'); variable 5 xmlwriter_set_indent($xw, 1); 11 xmlwriter_start_element($xw, 'tag1'); 15 xmlwriter_text($xw, 'valueofatt1'); 16 xmlwriter_end_attribute($xw); 25 xmlwriter_end_element($xw); // tag1 34 xmlwriter_start_cdata($xw); 36 xmlwriter_end_cdata($xw); 40 xmlwriter_start_pi($xw, 'php'); 42 xmlwriter_end_pi($xw); [all …]
|
H A D | xmlwriter_mem.php | 4 $xw = xmlwriter_open_memory(); variable 5 xmlwriter_set_indent($xw, 1); 11 xmlwriter_start_element($xw, 'tag1'); 14 xmlwriter_start_attribute($xw, 'att1'); 15 xmlwriter_text($xw, 'valueofatt1'); 16 xmlwriter_end_attribute($xw); 19 xmlwriter_end_element($xw); // tag1 22 $res = xmlwriter_start_comment($xw); 24 $res = xmlwriter_end_comment($xw); 26 xmlwriter_end_document($xw); [all …]
|
H A D | xmlwriter_mem_ns.php | 4 $xw = xmlwriter_open_memory(); variable 5 xmlwriter_set_indent($xw, 1); 6 $res = xmlwriter_set_indent_string($xw, ' '); 8 xmlwriter_start_document($xw, '1.0', 'UTF-8'); 10 xmlwriter_start_element_ns($xw,'prefix', 'books', 'uri'); 11 xmlwriter_start_attribute($xw, 'isbn'); 21 xmlwriter_end_attribute($xw); 23 xmlwriter_text($xw, 'book1'); 24 xmlwriter_end_element($xw); 26 xmlwriter_end_document($xw); [all …]
|
H A D | xmlwriter_oo.php | 2 $xw = new XMLWriter(); variable 3 $xw->openUri('test.xml'); 4 $xw->startDocument("1.0"); 5 $xw->startElement("book"); 6 $xw->text("example"); 7 $xw->endElement(); 8 $xw->endDocument(); 9 $xw->flush(0);
|
/PHP-7.2/ext/xmlwriter/tests/ |
H A D | OO_009.phpt | 13 $xw = new XMLWriter(); 14 $xw->openMemory(); 15 $xw->setIndent(TRUE); 24 $xw->endElement(); 26 $xw->startCdata(); 27 $xw->text('<>&"'); 28 $xw->endCdata(); 29 $xw->endElement(); 30 $xw->endElement(); 31 $xw->endElement(); [all …]
|
H A D | 009.phpt | 14 $xw = xmlwriter_open_memory(); 15 xmlwriter_set_indent($xw, TRUE); 22 xmlwriter_start_element($xw, 'pi'); 24 xmlwriter_end_element($xw); 26 xmlwriter_start_cdata($xw); 27 xmlwriter_text($xw, '<>&"'); 28 xmlwriter_end_cdata($xw); 29 xmlwriter_end_element($xw); 30 xmlwriter_end_element($xw); 31 xmlwriter_end_element($xw); [all …]
|
H A D | bug41287.phpt | 10 $xw = xmlwriter_open_memory(); 12 xmlwriter_start_document($xw); 17 xmlwriter_end_element($xw); 18 xmlwriter_end_document($xw); 22 $xw = new XMLWriter(); 23 $xw->openMemory(); 24 $xw->setIndent(true); 25 $xw->startDocument(); 30 $xw->endElement(); 31 $xw->endDocument(); [all …]
|
H A D | 008.phpt | 11 $xw = xmlwriter_open_memory(); 12 xmlwriter_set_indent($xw, TRUE); 13 xmlwriter_start_document($xw, NULL, "UTF-8"); 15 xmlwriter_text($xw, "val"); 16 xmlwriter_end_dtd_entity($xw); 20 xmlwriter_start_dtd_element($xw, 'elem1'); 21 xmlwriter_text($xw, 'elem2*'); 22 xmlwriter_end_dtd_element($xw); 26 xmlwriter_end_dtd_attlist($xw); 27 xmlwriter_end_document($xw); [all …]
|
H A D | bug39504.phpt | 10 $xw = xmlwriter_open_memory(); 12 xmlwriter_start_dtd($xw, "root"); 14 xmlwriter_end_dtd($xw); 16 xmlwriter_end_document($xw); 20 $xw = new XMLWriter(); 21 $xw->openMemory(); 23 $xw->startDtd("root"); 25 $xw->endDtd(); 26 $xw->startElement("root"); 27 $xw->endDocument(); [all …]
|
H A D | OO_007.phpt | 12 $xw = new XMLWriter(); 13 $xw->openMemory(); 14 $xw->setIndent(TRUE); 15 $xw->setIndentString(' '); 17 $xw->startElement('root'); 20 $xw->text('a&b'); 21 $xw->endAttribute(); 24 $xw->text("<>\"'&"); 25 $xw->endAttribute(); 27 $xw->endElement(); [all …]
|
H A D | 007.phpt | 12 $xw = xmlwriter_open_memory(); 13 xmlwriter_set_indent($xw, TRUE); 14 xmlwriter_set_indent_string($xw, ' '); 16 xmlwriter_start_element($xw, 'root'); 19 xmlwriter_text($xw, 'a&b'); 20 xmlwriter_end_attribute($xw); 23 xmlwriter_text($xw, "<>\"'&"); 24 xmlwriter_end_attribute($xw); 26 xmlwriter_end_element($xw); 27 xmlwriter_end_document($xw); [all …]
|
H A D | OO_008.phpt | 11 $xw = new XMLWriter(); 12 $xw->openMemory(); 13 $xw->setIndent(TRUE); 14 $xw->startDocument(NULL, "UTF-8"); 17 $xw->startDtdElement('elem1'); 18 $xw->text('elem2*'); 19 $xw->endDtdElement(); 20 $xw->startDtdAttlist('elem1'); 23 $xw->endDtdAttlist(); 24 $xw->endDocument(); [all …]
|
H A D | OO_003.phpt | 9 $xw = new XMLWriter(); 10 $xw->openMemory(); 11 $xw->startDocument('1.0', 'UTF-8'); 12 $xw->startElement("tag1"); 15 $xw->text("attr1_value"); 16 $xw->endAttribute(); 19 $xw->text("attr2_value"); 20 $xw->endAttribute(); 22 $xw->text("Test text for tag1"); 28 $xw->endDocument(); [all …]
|
H A D | xmlwriter_write_attribute_ns_error_001.phpt | 7 $xw = xmlwriter_open_memory(); 8 xmlwriter_set_indent($xw, TRUE); 9 xmlwriter_start_document($xw, NULL, "UTF-8"); 10 xmlwriter_start_element($xw, 'root'); 12 xmlwriter_start_element($xw, 'elem1'); 14 xmlwriter_end_element($xw); 15 xmlwriter_full_end_element($xw); 16 xmlwriter_end_document($xw); 18 $output = xmlwriter_flush($xw, true); 22 $xw = xmlwriter_open_memory(); [all …]
|
H A D | OO_011.phpt | 15 $xw = new XMLWriter(); 16 $xw->openMemory(); 17 $xw->setIndent(TRUE); 18 $xw->setIndentString(' '); 19 $xw->startDocument('1.0', "UTF-8"); 20 $xw->startElement('root'); 24 $xw->endElement(); 25 $xw->startElement('empty'); 26 $xw->fullEndElement(); 27 $xw->fullEndElement(); [all …]
|
H A D | OO_005.phpt | 13 $xw = new XMLWriter(); 14 $xw->openUri($doc_dest); 15 $xw->startDocument('1.0', 'UTF-8'); 16 $xw->startElement("tag1"); 17 $xw->startComment(); 18 $xw->text('comment'); 19 $xw->endComment(); 20 $xw->writeComment("comment #2"); 21 $xw->endDocument(); 24 $output_bytes = $xw->flush(true); [all …]
|
H A D | 012.phpt | 15 $xw = xmlwriter_open_memory(); 16 xmlwriter_set_indent($xw, TRUE); 17 xmlwriter_set_indent_string($xw, ' '); 18 xmlwriter_start_document($xw, '1.0', "UTF-8"); 19 xmlwriter_start_element($xw, 'root'); 20 xmlwriter_start_element_ns($xw, 'ns1', 'child1', 'urn:ns1'); 23 xmlwriter_end_element($xw); 24 xmlwriter_start_element($xw, 'empty'); 25 xmlwriter_full_end_element($xw); 26 xmlwriter_full_end_element($xw); [all …]
|
H A D | xmlwriter_write_attribute_ns_basic_001.phpt | 7 $xw = xmlwriter_open_memory(); 8 xmlwriter_set_indent($xw, TRUE); 9 xmlwriter_start_document($xw, NULL, "UTF-8"); 10 xmlwriter_start_element($xw, 'root'); 11 xmlwriter_write_attribute_ns($xw, 'prefix', 'id', 'http://www.php.net/uri', 'elem1'); 12 xmlwriter_start_element($xw, 'elem1'); 13 xmlwriter_write_attribute($xw, 'attr1', 'first'); 14 xmlwriter_end_element($xw); 15 xmlwriter_full_end_element($xw); 16 xmlwriter_end_document($xw); [all …]
|
H A D | 003.phpt | 10 $xw = xmlwriter_open_memory($doc_dest); 11 xmlwriter_start_document($xw, '1.0', 'UTF-8'); 12 xmlwriter_start_element($xw, "tag1"); 15 $res = xmlwriter_start_attribute($xw, 'attr1'); 16 xmlwriter_text($xw, "attr1_value"); 17 xmlwriter_end_attribute($xw); 19 xmlwriter_write_attribute($xw, "att2", "att2_value"); 20 xmlwriter_text($xw, "Test text for tag1"); 21 $res = xmlwriter_start_element($xw, 'tag2'); 26 xmlwriter_end_document($xw); [all …]
|
H A D | 005-mb.phpt | 13 $xw = xmlwriter_open_uri($doc_dest); 14 xmlwriter_start_document($xw, '1.0', 'UTF-8'); 15 xmlwriter_start_element($xw, "tag1"); 17 xmlwriter_start_comment($xw); 18 xmlwriter_text($xw, 'comment'); 19 xmlwriter_end_comment($xw); 20 xmlwriter_write_comment($xw, "comment #2"); 21 xmlwriter_end_document($xw); 24 $output_bytes = xmlwriter_flush($xw, true); 26 unset($xw);
|
H A D | 005.phpt | 13 $xw = xmlwriter_open_uri($doc_dest); 14 xmlwriter_start_document($xw, '1.0', 'UTF-8'); 15 xmlwriter_start_element($xw, "tag1"); 17 xmlwriter_start_comment($xw); 18 xmlwriter_text($xw, 'comment'); 19 xmlwriter_end_comment($xw); 20 xmlwriter_write_comment($xw, "comment #2"); 21 xmlwriter_end_document($xw); 24 $output_bytes = xmlwriter_flush($xw, true); 26 unset($xw);
|
H A D | OO_010.phpt | 15 $xw = new XMLWriter(); 16 $xw->openMemory(); 17 $xw->setIndent(TRUE); 18 $xw->setIndentString(' '); 19 $xw->startDocument('1.0', "UTF-8"); 20 $xw->startElement('root'); 21 $xw->startElementNS('ns1', 'child1', 'urn:ns1'); 23 $xw->writeElement('chars', "special characters: <>\"'&"); 24 $xw->endElement(); 25 $xw->endDocument(); [all …]
|
H A D | OO_004.phpt | 10 $xw = new XMLWriter(); 11 $xw->openUri($doc_dest); 12 $xw->startDocument('1.0', 'UTF-8'); 13 $xw->startElement("tag1"); 15 $xw->startPi("PHP"); 16 $xw->text('echo $a;'); 17 $xw->endPi(); 18 $xw->endDocument(); 21 $xw->flush(true); 26 unset($xw);
|
H A D | 011.phpt | 15 $xw = xmlwriter_open_memory(); 16 xmlwriter_set_indent($xw, TRUE); 17 xmlwriter_set_indent_string($xw, ' '); 18 xmlwriter_start_document($xw, '1.0', "UTF-8"); 19 xmlwriter_start_element($xw, 'root'); 20 xmlwriter_start_element_ns($xw, 'ns1', 'child1', 'urn:ns1'); 21 xmlwriter_write_attribute_ns($xw, 'ns1','att1', 'urn:ns1', '<>"\'&'); 22 xmlwriter_write_element($xw, 'chars', "special characters: <>\"'&"); 23 xmlwriter_end_element($xw); 24 xmlwriter_end_document($xw); [all …]
|
H A D | 010.phpt | 12 $xw = xmlwriter_open_uri($file); 14 var_dump(xmlwriter_start_element($xw, "tag")); 15 var_dump(xmlwriter_start_attribute($xw, "attr")); 16 var_dump(xmlwriter_end_attribute($xw)); 17 var_dump(xmlwriter_start_attribute($xw, "-1")); 18 var_dump(xmlwriter_end_attribute($xw)); 19 var_dump(xmlwriter_start_attribute($xw, "\"")); 20 var_dump(xmlwriter_end_attribute($xw)); 21 var_dump(xmlwriter_end_element($xw)); 23 unset($xw);
|