summaryrefslogtreecommitdiff
path: root/ext/dom/examples
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom/examples')
-rw-r--r--ext/dom/examples/dom1.inc43
-rw-r--r--ext/dom/examples/dom1.php94
-rw-r--r--ext/dom/examples/note-invalid.xml9
-rw-r--r--ext/dom/examples/note.dtd6
-rw-r--r--ext/dom/examples/note.php19
-rw-r--r--ext/dom/examples/note.xml8
-rw-r--r--ext/dom/examples/relaxNG.php11
-rw-r--r--ext/dom/examples/relaxNG.rng11
-rw-r--r--ext/dom/examples/relaxNG.xml1
-rw-r--r--ext/dom/examples/relaxNG2.rng23
-rw-r--r--ext/dom/examples/relaxNG3.rng8
-rw-r--r--ext/dom/examples/shipping.php11
-rw-r--r--ext/dom/examples/shipping.xml21
-rw-r--r--ext/dom/examples/shipping.xsd36
14 files changed, 0 insertions, 301 deletions
diff --git a/ext/dom/examples/dom1.inc b/ext/dom/examples/dom1.inc
deleted file mode 100644
index 792d6f2dbc..0000000000
--- a/ext/dom/examples/dom1.inc
+++ /dev/null
@@ -1,43 +0,0 @@
-<?PHP
-$xmlstr = "<?xml version='1.0' standalone='yes'?>
-<!DOCTYPE chapter SYSTEM '/share/sgml/Norman_Walsh/db3xml10/db3xml10.dtd'
-[ <!ENTITY sp \"spanish\">
-]>
-<!-- lsfj -->
-<chapter language='en'><title language='en'>Title</title>
-<para language='ge'>
-&sp;
-<!-- comment -->
-<informaltable language='&sp;kkk'>
-<tgroup cols='3'>
-<tbody>
-<row><entry>a1</entry><entry morerows='1'>b1</entry><entry>c1</entry></row>
-<row><entry>a2</entry><entry>c2</entry></row>
-<row><entry>a3</entry><entry>b3</entry><entry>c3</entry></row>
-</tbody>
-</tgroup>
-</informaltable>
-</para>
-</chapter> ";
-
-function print_node($node)
-{
- print "Node Name: " . $node->nodeName;
- print "\nNode Type: " . $node->nodeType;
- $child_count = $node->childNodes->length;
- print "\nNum Children: " . $child_count;
- if($child_count <= 1){
- print "\nNode Content: " . $node->nodeValue;
- }
- print "\n\n";
-}
-
-function print_node_list($nodelist)
-{
- foreach($nodelist as $node)
- {
- print_node($node);
- }
-}
-
-?>
diff --git a/ext/dom/examples/dom1.php b/ext/dom/examples/dom1.php
deleted file mode 100644
index 8ea367458d..0000000000
--- a/ext/dom/examples/dom1.php
+++ /dev/null
@@ -1,94 +0,0 @@
-<?php
-require_once("dom1.inc");
-
-echo "Test 1: accessing single nodes from php\n";
-$dom = new domDocument;
-$dom->loadxml($xmlstr);
-if(!$dom) {
- echo "Error while parsing the document\n";
- exit;
-}
-
-// children() of of document would result in a memleak
-//$children = $dom->children();
-//print_node_list($children);
-
-echo "--------- root\n";
-$rootnode = $dom->documentElement;
-print_node($rootnode);
-
-echo "--------- children of root\n";
-$children = $rootnode->childNodes;
-print_node_list($children);
-
-// The last node should be identical with the last entry in the children array
-echo "--------- last\n";
-$last = $rootnode->lastChild;
-print_node($last);
-
-// The parent of this last node is the root again
-echo "--------- parent\n";
-$parent = $last->parentNode;
-print_node($parent);
-
-// The children of this parent are the same children as one above
-echo "--------- children of parent\n";
-$children = $parent->childNodes;
-print_node_list($children);
-
-echo "--------- creating a new attribute\n";
-//This is worthless
-//$attr = $dom->createAttribute("src", "picture.gif");
-//print_r($attr);
-
-//$rootnode->set_attributeNode($attr);
-$attr = $rootnode->setAttribute("src", "picture.gif");
-$attr = $rootnode->getAttribute("src");
-print_r($attr);
-print "\n";
-
-echo "--------- Get Attribute Node\n";
-$attr = $rootnode->getAttributeNode("src");
-print_node($attr);
-
-echo "--------- Remove Attribute Node\n";
-$attr = $rootnode->removeAttribute("src");
-print "Removed " . $attr . " attributes.\n";
-
-echo "--------- attributes of rootnode\n";
-$attrs = $rootnode->attributes;
-print_node_list($attrs);
-
-echo "--------- children of an attribute\n";
-$children = $attrs->item(0)->childNodes;
-print_node_list($children);
-
-echo "--------- Add child to root\n";
-$myelement = new domElement("Silly", "Symphony");
-$newchild = $rootnode->appendChild($myelement);
-print_node($newchild);
-print $dom->saveXML();
-print "\n";
-
-echo "--------- Find element by tagname\n";
-echo " Using dom\n";
-$children = $dom->getElementsByTagname("Silly");
-print_node_list($children);
-
-echo " Using elem\n";
-$children = $rootnode->getElementsByTagName("Silly");
-print_node_list($children);
-
-echo "--------- Unlink Node\n";
-print_node($children->item(0));
-$rootnode->removeChild($children->item(0));
-print_node_list($rootnode->childNodes);
-print $dom->savexml();
-
-echo "--------- Find element by id\n";
-print ("Not implemented\n");
-
-echo "--------- Check various node_name return values\n";
-print ("Not needed\n");
-
-?>
diff --git a/ext/dom/examples/note-invalid.xml b/ext/dom/examples/note-invalid.xml
deleted file mode 100644
index 58d4e65044..0000000000
--- a/ext/dom/examples/note-invalid.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?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>
diff --git a/ext/dom/examples/note.dtd b/ext/dom/examples/note.dtd
deleted file mode 100644
index c2d558eee4..0000000000
--- a/ext/dom/examples/note.dtd
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!ELEMENT note (to,from,heading,body)>
-<!ELEMENT to (#PCDATA)>
-<!ELEMENT from (#PCDATA)>
-<!ELEMENT heading (#PCDATA)>
-<!ELEMENT body (#PCDATA)>
diff --git a/ext/dom/examples/note.php b/ext/dom/examples/note.php
deleted file mode 100644
index a8695f3664..0000000000
--- a/ext/dom/examples/note.php
+++ /dev/null
@@ -1,19 +0,0 @@
-<?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";
-}
-
-?>
diff --git a/ext/dom/examples/note.xml b/ext/dom/examples/note.xml
deleted file mode 100644
index 49614a1b52..0000000000
--- a/ext/dom/examples/note.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?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>
-</note>
diff --git a/ext/dom/examples/relaxNG.php b/ext/dom/examples/relaxNG.php
deleted file mode 100644
index d265fd988e..0000000000
--- a/ext/dom/examples/relaxNG.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$dom = new domDocument;
-$dom->load('relaxNG.xml');
-if (!$dom->relaxNGValidate('relaxNG.rng')) {
- print "Document is not valid";
-} else {
- print "Document is valid";
-}
-
-?> \ No newline at end of file
diff --git a/ext/dom/examples/relaxNG.rng b/ext/dom/examples/relaxNG.rng
deleted file mode 100644
index f4357e04ef..0000000000
--- a/ext/dom/examples/relaxNG.rng
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<grammar xmlns="http://relaxng.org/ns/structure/1.0"
- datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-
-<include href="relaxNG2.rng">
-<define name="TEI.prose"><ref name="INCLUDE"/></define>
-</include>
-</grammar>
-
-
-
diff --git a/ext/dom/examples/relaxNG.xml b/ext/dom/examples/relaxNG.xml
deleted file mode 100644
index 6b0cac1225..0000000000
--- a/ext/dom/examples/relaxNG.xml
+++ /dev/null
@@ -1 +0,0 @@
-<TEI.2>hello</TEI.2> \ No newline at end of file
diff --git a/ext/dom/examples/relaxNG2.rng b/ext/dom/examples/relaxNG2.rng
deleted file mode 100644
index 4adae7b151..0000000000
--- a/ext/dom/examples/relaxNG2.rng
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:t="http://www.thaiopensource.com/ns/annotations" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-
- <start>
- <ref name="TEI.2"/>
- </start>
- <define name="IGNORE">
- <notAllowed/>
- </define>
- <define name="INCLUDE">
- <empty/>
- </define>
-
-
- <include href="relaxNG3.rng"/>
-
- <define name="TEI.2">
- <element name="TEI.2">
- <text/>
- </element>
- </define>
-
-</grammar> \ No newline at end of file
diff --git a/ext/dom/examples/relaxNG3.rng b/ext/dom/examples/relaxNG3.rng
deleted file mode 100644
index 73e1eb6165..0000000000
--- a/ext/dom/examples/relaxNG3.rng
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:t="http://www.thaiopensource.com/ns/annotations" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
-
- <define name="TEI.prose" combine="interleave">
- <ref name="IGNORE"/>
- </define>
-
-</grammar> \ No newline at end of file
diff --git a/ext/dom/examples/shipping.php b/ext/dom/examples/shipping.php
deleted file mode 100644
index 5205fd2014..0000000000
--- a/ext/dom/examples/shipping.php
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-$dom = new domDocument;
-$dom->load('shipping.xml');
-if (!$dom->schemaValidate('shipping.xsd')) {
- print "Document is not valid";
-} else {
- print "Document is valid";
-}
-
-?> \ No newline at end of file
diff --git a/ext/dom/examples/shipping.xml b/ext/dom/examples/shipping.xml
deleted file mode 100644
index dc8a09e301..0000000000
--- a/ext/dom/examples/shipping.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0"?>
-<shipOrder>
- <shipTo>
- <name>Tove Svendson</name>
- <street>Ragnhildvei 2</street>
- <address>4000 Stavanger</address>
- <country>Norway</country>
- </shipTo>
- <items>
- <item>
- <title>Empire Burlesque</title>
- <quantity>1</quantity>
- <price>10.90</price>
- </item>
- <item>
- <title>Hide your heart</title>
- <quantity>1</quantity>
- <price>9.90</price>
- </item>
- </items>
-</shipOrder> \ No newline at end of file
diff --git a/ext/dom/examples/shipping.xsd b/ext/dom/examples/shipping.xsd
deleted file mode 100644
index 8b16b7c03a..0000000000
--- a/ext/dom/examples/shipping.xsd
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0"?>
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:element name="shipOrder" type="order"/>
-
- <xsd:complexType name="order">
- <xsd:all>
- <xsd:element name="shipTo" type="shipAddress"/>
- <xsd:element name="items" type="cdItems"/>
- </xsd:all>
- </xsd:complexType>
-
- <xsd:complexType name="shipAddress">
- <xsd:all>
- <xsd:element name="name" type="xsd:string"/>
- <xsd:element name="street" type="xsd:string"/>
- <xsd:element name="address" type="xsd:string"/>
- <xsd:element name="country" type="xsd:string"/>
- </xsd:all>
- </xsd:complexType>
-
- <xsd:complexType name="cdItems">
- <xsd:sequence>
- <xsd:element name="item" type="cdItem" maxOccurs="unbounded" minOccurs="1"/>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="cdItem">
- <xsd:all>
- <xsd:element name="title" type="xsd:string"/>
- <xsd:element name="quantity" type="xsd:positiveInteger"/>
- <xsd:element name="price" type="xsd:decimal"/>
- </xsd:all>
- </xsd:complexType>
-
-</xsd:schema> \ No newline at end of file