Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
XSD Schema 1.1 validation in PHP

I have figured out how to validate an XML file using an XSD schema in PHP using this code, but it appears the processing is done using XSD version 1.0.

$dom = new DOMDocument();
$dom->loadXML($xmlString);

$isValid = $dom->schemaValidate($xsdFile);

For my case, I need the XSD file to be treated as version 1.1. The main reason for this is that I want to use:

<xs:all>
   <xs:element type="xs:string" name="br" minOccurs="0" maxOccurs="unbounded"/>
   <xs:element type="linkType" name="link" minOccurs="0" maxOccurs="unbounded"/>
</xs:all>

Notice the maxOccurs="unbounded" which can only be used inside <xs:all> with version 1.1. In version 1.0, the maxOccurs can only be 0 or 1.

PHP fails with the generic error:

Warning: DOMDocument::schemaValidate(): Invalid Schema
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

DOMDocument::schemaValidate use Libxml. Libxml does not support XSD 1.1.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!