Annotation of embedaddon/php/ext/dom/tests/DOMDocumentType_basic_001.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: DOMDocumentType: basic access to all properties.
3: --CREDITS--
4: Eric Lee Stewart <ericleestewart@gmail.com>
5: # TestFest Atlanta 2009-05-25
6: --SKIPIF--
7: <?php require_once('skipif.inc'); ?>
8: --FILE--
9: <?php
10: // Access publicId, systemId, name, internalSubset all with values.
11: $xml = '<?xml version="1.0" encoding="UTF-8" ?>';
12: $xml .= '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML//EN" "docbookx.dtd">';
13: $xml .= '<chapter>1</chapter>';
14: $doc = new DOMDocument();
15: $doc->loadXML($xml);
16: $doctype = $doc->doctype;
17: print "publicId: ".$doctype->publicId."\n";
18: print "systemId: ".$doctype->systemId."\n";
19: print "name: ".$doctype->name."\n";
20: print "internalSubset: ".$doctype->internalSubset."\n";
21:
22:
23: // Access entities and notations with values.
24: $xml = '<?xml version="1.0" encoding="UTF-8" ?>';
25: $xml .= '<!DOCTYPE img [';
26: $xml .= ' <!ELEMENT img EMPTY>';
27: $xml .= ' <!ATTLIST img src ENTITY #REQUIRED>';
28: $xml .= ' <!ENTITY logo SYSTEM "http://www.xmlwriter.net/logo.gif" NDATA gif>';
29: $xml .= ' <!NOTATION gif PUBLIC "gif viewer">';
30: $xml .= ']>';
31: $xml .= '<img src="logo"/>';
32: $doc = new DOMDocument();
33: $doc->loadXML($xml);
34: $doctype = $doc->doctype;
35: $entities = $doctype->entities;
36: $entity = $entities->item(0);
37: print 'entity: '.$entity->nodeName."\n";
38: $notations = $doctype->notations;
39: $notation = $notations->item(0);
40: print 'notation: '.$notation->nodeName."\n";
41: ?>
42: --EXPECT--
43: publicId: -//OASIS//DTD DocBook XML//EN
44: systemId: docbookx.dtd
45: name: chapter
1.1.1.2 ! misho 46: internalSubset:
1.1 misho 47: entity: logo
1.1.1.2 ! misho 48: notation: gif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>