cvs: php-src /ext/dom/examples note-invalid.xml note.dtd note.php

From: Date: Thu, 09 Oct 2003 05:46:04 +0000
Subject: cvs: php-src /ext/dom/examples note-invalid.xml note.dtd note.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-24104@lists.php.net to get a copy of this message
shane Thu Oct 9 01:46:04 2003 EDT Added files: /php-src/ext/dom/examples note-invalid.xml note.dtd note.php Log: add a DTD example Index: php-src/ext/dom/examples/note-invalid.xml +++ php-src/ext/dom/examples/note-invalid.xml <?xml version="1.0"?> <!DOCTYPE note SYSTEM "note.dtd"> <note> <to>PHP User Group</to> <from>Shane</from> <heading>Reminder</heading> <body>Don't forget the meeting tonight!</body> <footer>Or I'll clobber you!</footer> </note> Index: php-src/ext/dom/examples/note.dtd +++ php-src/ext/dom/examples/note.dtd <?xml version="1.0" ?> <!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> Index: php-src/ext/dom/examples/note.php +++ php-src/ext/dom/examples/note.php <?php $dom = new domDocument; $dom->load('note.xml'); if (!$dom->validate('note.dtd')) { print "Document note.dtd is not valid\n"; } else { print "Document note.dtd is valid\n"; } $dom = new domDocument; $dom->load('note-invalid.xml'); if (!$dom->validate('note.dtd')) { print "Document note-invalid.xml is not valid\n"; } else { print "Document note-invalid.xml is valid\n"; } ?>

« previous php.cvs (#24104) next »