Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema

Both XML::LibXML::Schema and XML::Validator::Schema error when I
attempt to validate, yet the XML and XSD files appear to be perfectly

XML::LibXML::Schema errors with:
Element '{}element', attribute 'ref':
References from this schema to components in the namespace '' are not
allowed, since not indicated by an import statement.


my $parser = XML::LibXML->new();
my $doc = $parser->parse_file("TV.xml");
my $v = XML::LibXML::Schema->new(location=>"TV.xsd");
eval { $v->validate($doc); };
die $@ if $@;


XML::Validator::Schema errors with:
Found <simpleType> illegally combined with <complexType>.
line 64
at ./ line 234

<simpleType> is allowed to be nested withen a <complexType> correct? As
the examples I have seen on the w3c's schema tutorial nest them.
LibXML's error, well I thought a "ref" to a element withen the same
namespace (none) is perfectly ok.


my $v = XML::Validator::Schema->new(file=>"TV.xsd");
my $p = XML::SAX::ParserFactory->parser(handler=>$v);
eval { $p->parse_uri("TV.xml") };
die $@ if $@;

Both fXML and XSD files are quite long, but I will post if necessary.
Im not sure these errors are do to a problem with Perl's
implementation, in javax.xml.validation.Validator they validated ok;
maybe Java's implementation is more relaxed....?

Thanks in advance