php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44436 XML schema validation failing for SMIL language
Submitted: 2008-03-14 13:52 UTC Modified: 2008-03-14 15:08 UTC
From: denis at edistar dot com Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
 [2008-03-14 13:52 UTC] denis at edistar dot com
Description:
------------
I'm trying to validate a SMIL document using DOMDocument and the official w3c schema.

The validation fails throwing several warnings.


Reproduce code:
---------------
<?

$smil = "<smil xmlns=\"http://www.w3.org/2001/SMIL20/Language\">
<head>
 <layout>
  <region id=\"schermo\" width=\"100%\" height=\"100%\" left=\"0\" top=\"0\" />
 </layout>
</head>
<body>
 <par>
  <img src=\"cid:star1.jpg\" region=\"schermo\" />
 </par>
 <par>
  <text src=\"cid:testo\" region=\"schermo\" />
 </par>
</body>
</smil>";


$docSmil = new DOMDocument();
if (! $docSmil->loadXML($smil, LIBXML_NOCDATA)) {
        throw new Exception("The SMIL file is not a valid xml document");
}

if (! $docSmil->schemaValidate('http://www.w3.org/2001/SMIL20/smil20.xsd')) {
        throw new Exception("IThe SMIL file is not a valid SMIL document");
}
echo "OK\n";
?>


Expected result:
----------------
OK

Actual result:
--------------
Warning: DOMDocument::schemaValidate(): Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'type': References from this schema to components in the namespace 'http://www.w3.org/2001/SMIL20/Language' are not allowed, since not indicated by an import statement. in /tmp/test.php on line 25

Warning: DOMDocument::schemaValidate(): Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'type': References from this schema to components in the namespace 'http://www.w3.org/2001/SMIL20/Language' are not allowed, since not indicated by an import statement. in /tmp/test.php on line 25

Warning: DOMDocument::schemaValidate(): Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'type': References from this schema to components in the namespace 'http://www.w3.org/2001/SMIL20/Language' are not allowed, since not indicated by an import statement. in /tmp/test.php on line 25

Warning: DOMDocument::schemaValidate(): Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'type': References from this schema to components in the namespace 'http://www.w3.org/2001/SMIL20/Language' are not allowed, since not indicated by an import statement. in /tmp/test.php on line 25

Warning: DOMDocument::schemaValidate(): Element '{http://www.w3.org/2001/XMLSchema}element', attribute 'type': References from this schema to components in the namespace 'http://www.w3.org/2001/SMIL20/Language' are not allowed, since not indicated by an import statement. in /tmp/test.php on line 25

Warning: DOMDocument::schemaValidate(): Invalid Schema in /tmp/test.php on line 25

Fatal error: Uncaught exception 'Exception' with message 'IThe SMIL file is not a valid SMIL document' in /tmp/test.php:26
Stack trace:
#0 {main}
  thrown in /tmp/test.php on line 26


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-14 15:08 UTC] rrichards@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

This is a libxml2 issue not PHP
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 20:01:45 2024 UTC