|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #75335 Missing code example in DOMDocument::schemaValidate
Submitted: 2017-10-08 00:34 UTC Modified: 2017-10-28 15:45 UTC
From: peterkokot at gmail dot com Assigned:
Status: Open Package: DOM XML related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-10-08 00:34 UTC] peterkokot at gmail dot com
Documentation at is missing a code example. I would suggest to add an example from the php-src repository:

<?xml version="1.0"?>
    <name>Tove Svendson</name>
    <street>Ragnhildvei 2</street>
    <address>4000 Stavanger</address>
      <title>Empire Burlesque</title>
      <title>Hide your heart</title>

<?xml version="1.0"?>
<xsd:schema xmlns:xsd=""> 

    <xsd:element       name="shipOrder" type="order"/> 
    <xsd:complexType   name="order">
            <xsd:element   name="shipTo"    type="shipAddress"/>
            <xsd:element   name="items"     type="cdItems"/>
    <xsd:complexType   name="shipAddress">
            <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:complexType   name="cdItems">
            <xsd:element   name="item"      type="cdItem"  maxOccurs="unbounded" minOccurs="1"/>
    <xsd:complexType   name="cdItem">
            <xsd:element   name="title"     type="xsd:string"/>
            <xsd:element   name="quantity"  type="xsd:positiveInteger"/>
            <xsd:element   name="price"     type="xsd:decimal"/>



$dom = new domDocument;
if (!$dom->schemaValidate('shipping.xsd')) {
  print "Document is not valid";
} else {
  print "Document is valid";


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-28 15:45 UTC]
-Package: Documentation problem +Package: DOM XML related
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 21 09:01:28 2024 UTC