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
fine.

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

Code:

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>.
at
/usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/XML/LibXML/SAX.pm
line 64
at ./transform.pl 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.

Code:

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

.



Relevant Pages

  • RE: Error working with a csv flat file
    ... Do I need to use an Orchestration with this and include a flat file ... > The properties set at the schema level are Schema Editor Extensions Flat ... > Occurs unbounded, Child Delimeter Type Character, Child Delimiter, Child ... > When I validate my schema it validates fine. ...
    (microsoft.public.biztalk.general)
  • Re: xsd files only: enough to start writing app. code of a DB-related component ?
    ... These schema definition files aren't very numerous (about 20 ... EIS database directly, and the database we were interested in was ISAM, and ... If they are good XSD files consider yourselves lucky. ... database schema from an XML schema. ...
    (comp.lang.java.programmer)
  • Re: XML Schema validation error
    ... validating XML reader in dotnet code. ... so I need to fix the schema so that it validates. ... I then validate an xdp file ...
    (microsoft.public.dotnet.xml)
  • Re: Validation of a stack of XSD files (.NET 2.0)
    ... I get a few warnings and 3 errors - I haven't tracked down which XSD files they're in yet. ... > Simply open the file in Visual Studio, ... I can scroll down and Use that schema. ... > first error but continue to process the main schema and includes and ...
    (microsoft.public.dotnet.xml)
  • Error working with a csv flat file
    ... I am getting an error when I try to process a flat file through BizTalk. ... My schema looks like this. ... Child Delimiter 0x0D 0x0A, Child Delimiter Type Hexadecimal, Child Order ... When I validate my schema it validates fine. ...
    (microsoft.public.biztalk.general)