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