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

  • Validating Optional Segments in FLatFile
    ... So when i get this kind of input file,When i am trying to validate against the schema, only segment 1 is recognised in the message and only Segment1 is getting populated in the validated output. ... I came across an issue while dealing with the flat file. ... Ok so from there I specify that all the ChildElements are optional ...
    (microsoft.public.biztalk.general)
  • Re: Validating Optional Segments in FLatFile
    ... So when i get this kind of input file,When i am trying to validate against the schema, only segment 1 is recognised in the message and only Segment1 is getting populated in the validated output. ... I came across an issue while dealing with the flat file. ... Ok so from there I specify that all the ChildElements are optional ...
    (microsoft.public.biztalk.general)
  • 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 Validator
    ... What does your schema look like that is failing validation? ... Node) selected...the multiple root nodes in one XSD thing can cause ... I want to validate all incoming documents if they are known and are ... do so I created a BizTalk project with a receive pipeline. ...
    (microsoft.public.biztalk.general)