Re: [xml] Regarding LibXML Schema validation

2009-11-11 Thread Darko Miletic

Sudhindra Kulkarni wrote:


I have a problem validating a xml generated from a schema which 
contains an element having xs:any namespace=##other /. When I try 
to include a element from another schema I get an error

No matching global element declaration available but demanded by the 
strict wildcard

This is a limitation of libxml. You must have all declarations from all 
schemas in one file. So if your xml file uses 6 schemas in order to 
validate them in libxml you must create new schema that includes all 6 
separate schemas and than use that xsd for validation. Something like this:

?xml version = 1.0 encoding = UTF-8?
xs:schema xmlns=http://dummy.libxml2.validator;
   targetNamespace =http://dummy.libxml2.validator;
   xmlns:xsi   =;
   xmlns:somenamespace =namespaceurl
   xmlns:somenamespace2 =namespaceurl2
   xmlns:somenamespace3 =namespaceurl3

   elementFormDefault  =qualified
   xs:import namespace =namespaceurl schemaLocation = schema 
location /
   xs:import namespace =namespaceurl2 schemaLocation = schema 
location2 /
   xs:import namespace =namespaceurl3 schemaLocation = schema 
location3 /


xml mailing list, project page

[xml] RelaxNG schema and entities file: namespace warning : Namespace default prefix was not found

2009-11-11 Thread Daniel Leidert

Consider this example:

!DOCTYPE foo [
!ENTITY comment 'comment id=comment.xml /'
foo xmlns=;

When I run `xmllint --noout --noent --relaxng foo.rng foo.xml' I

| namespace warning : Namespace default prefix was not found
| ...
| element comment: Relax-NG validity error : Did not expect element comment 

But `jing foo.rng foo.xml' succeeds and does not complain. I have to add
the xmlns attribute to comment for xmllint to succeed. Is this correct
or an issue in xmllint? I wouldn't have expected, that I have to add the
namespace to this entity. I thought it gets directly replaced.

Regards, Daniel

xml mailing list, project page