1--TEST--
2DOMDocument::relaxNGValidateSource()
3--CREDITS--
4Knut Urdalen <knut@php.net>
5--EXTENSIONS--
6dom
7--FILE--
8<?php
9$rng = <<< RNG
10<?xml version="1.0" encoding="UTF-8"?>
11<grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0"
12  datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
13  <start>
14    <element name="apple">
15      <element name="pear">
16        <data type="NCName"/>
17      </element>
18    </element>
19  </start>
20</grammar>
21RNG;
22
23$good_xml = <<< GOOD_XML
24<?xml version="1.0"?>
25<apple>
26  <pear>Pear</pear>
27</apple>
28GOOD_XML;
29
30$doc = new DOMDocument();
31$doc->loadXML($good_xml);
32$result = $doc->relaxNGValidateSource($rng);
33var_dump($result);
34
35?>
36--EXPECT--
37bool(true)
38