+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!ELEMENT LIST (MOVIE+)>
-<!ELEMENT MOVIE (TITLE, ORGTITLE, LOC, INFO)>
-<!ATTLIST MOVIE ID ID #REQUIRED>
-<!ELEMENT TITLE (#PCDATA)>
-<!ELEMENT ORGTITLE (#PCDATA)>
-<!ELEMENT LOC (#PCDATA)>
-<!ELEMENT INFO (#PCDATA)>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE LIST SYSTEM "dtdexample.dtd">
-<LIST>
-<MOVIE ID="x200338360">
-<TITLE>Move Title 1</TITLE>
-<ORGTITLE/><LOC>Location 1</LOC>
-<INFO/>
-</MOVIE>
-<MOVIE ID="m200338361">
-<TITLE>Move Title 2</TITLE>
-<ORGTITLE/>
-<LOC>Location 2</LOC>
-<INFO/>
-</MOVIE>
-</LIST>
+++ /dev/null
-<?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>
-
-
-
+++ /dev/null
-<TEI.2>hello</TEI.2>
\ No newline at end of file
+++ /dev/null
-<?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
+++ /dev/null
-<?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
+++ /dev/null
-<books>
- <book num="1">
- <title>The Grapes of Wrath</title>
- <author>John Steinbeck</author>
- </book>
- <book num="2">
- <title>The Pearl</title>
- <author>John Steinbeck</author>
- </book>
-</books>
+++ /dev/null
-<?php
-$reader = new XMLReader();
-$reader->open('xmlreader.xml');
-while ($reader->read()) {
- if ($reader->nodeType != XMLREADER::END_ELEMENT) {
- print "Node Name: ".$reader->name."\n";
- print "Node Value: ".$reader->value."\n";
- print "Node Depth: ".$reader->depth."\n";
- if ($reader->nodeType==XMLREADER::ELEMENT && $reader->hasAttributes) {
- $attr = $reader->moveToFirstAttribute();
- while ($attr) {
- print " Attribute Name: ".$reader->name."\n";
- print " Attribute Value: ".$reader->value."\n";
- $attr = $reader->moveToNextAttribute();
- }
- }
- print "\n";
- }
-}
-?>
+++ /dev/null
-<?php
-$indent = 5; /* Number of spaces to indent per level */
-
-$reader = new XMLReader();
-$reader->open('relaxNG.xml');
-/*
-Example setting relaxNG using string:
-$reader->setRelaxNGSchemaSource(file_get_contents('relaxNG.rng'));
-*/
-if ($reader->setRelaxNGSchema('relaxNG.rng')) {
- while ($reader->read()) {
- /* Print node name indenting it based on depth and $indent var */
- print str_repeat(" ", $reader->depth * $indent).$reader->name."\n";
- }
-}
-
-print "\n";
-
-if (! $reader->isValid()) {
- print "Document is not valid\n";
-} else {
- print "Document is valid\n";
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-$xmlstring = '<books>
- <book num="1">
- <title>The Grapes of Wrath</title>
- <author>John Steinbeck</author>
- </book>
- <book num="2">
- <title>The Pearl</title>
- <author>John Steinbeck</author>
- </book>
-</books>';
-
-$reader = new XMLReader();
-$reader->XML($xmlstring);
-while ($reader->read()) {
- if ($reader->nodeType != XMLREADER::END_ELEMENT) {
- print "Node Name: ".$reader->name."\n";
- print "Node Value: ".$reader->value."\n";
- print "Node Depth: ".$reader->depth."\n";
- if ($reader->nodeType==XMLREADER::ELEMENT && $reader->hasAttributes) {
- $attr = $reader->moveToFirstAttribute();
- while ($attr) {
- print " Attribute Name: ".$reader->name."\n";
- print " Attribute Value: ".$reader->value."\n";
- $attr = $reader->moveToNextAttribute();
- }
- }
- print "\n";
- }
-}
-?>
+++ /dev/null
-<?php
-$indent = 5; /* Number of spaces to indent per level */
-
-$xml = new XMLReader();
-$xml->open("dtdexample.xml");
-$xml->setParserProperty(XMLREADER::LOADDTD, TRUE);
-$xml->setParserProperty(XMLREADER::VALIDATE, TRUE);
-while($xml->read()) {
- /* Print node name indenting it based on depth and $indent var */
- print str_repeat(" ", $xml->depth * $indent).$xml->name."\n";
- if ($xml->hasAttributes) {
- $attCount = $xml->attributeCount;
- print str_repeat(" ", $xml->depth * $indent)." Number of Attributes: ".$xml->attributeCount."\n";
- }
-}
-print "\n\nValid:\n";
-var_dump($xml->isValid());
-?>
\ No newline at end of file