Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

210
Visualizações
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 Respostas
Responde à pergunta

0

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

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda