From: Shane Caraveo Date: Thu, 9 Oct 2003 05:46:03 +0000 (+0000) Subject: add a DTD example X-Git-Tag: RELEASE_1_3b3~84 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0cf1ec40d7ae39ad1d8a362146dffdeac2240fa;p=php add a DTD example --- diff --git a/ext/dom/examples/note-invalid.xml b/ext/dom/examples/note-invalid.xml new file mode 100644 index 0000000000..58d4e65044 --- /dev/null +++ b/ext/dom/examples/note-invalid.xml @@ -0,0 +1,9 @@ + + + +PHP User Group +Shane +Reminder +Don't forget the meeting tonight! +
Or I'll clobber you!
+
diff --git a/ext/dom/examples/note.dtd b/ext/dom/examples/note.dtd new file mode 100644 index 0000000000..4016eb5811 --- /dev/null +++ b/ext/dom/examples/note.dtd @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ext/dom/examples/note.php b/ext/dom/examples/note.php new file mode 100644 index 0000000000..a8695f3664 --- /dev/null +++ b/ext/dom/examples/note.php @@ -0,0 +1,19 @@ +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"; +} + +?>