Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 67363
Status: rejected
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: mc-power [...] justmail.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug at ErrorReport by validate
Date: Sun, 10 Apr 2011 15:53:29 +0200
To: bug-XML-LibXML [...] rt.cpan.org
From: McPower <mc-power [...] justmail.de>
Hello, the validate Routine has a Problem with/minOccurs="0" //maxOccurs="0"/. The Error Message is wrong. The correct Message is /Schemas validity error : Element '{.....}b': This element is not expected./ It is only a Pointer Error in the library? i+1 ? XML: <a> <b>testA</b> <c>testB</c> </a> XSD: <xs:complexType name="a"> <xs:element name="b" type="myString100" minOccurs="0" maxOccurs="0"> </xs:element> <xs:element name="c" type="mxString100"> </xs:element> </xs:complexType> ERROR: in.xml:0: Schemas validity error : Element '{.....}c': This element is not expected. $xml_filename_or_url = "in.xml"; $schema_filename_or_url = "schema.xsd"; use XML::LibXML; $doc = XML::LibXML->new->parse_file($xml_filename_or_url); $xmlschema = XML::LibXML::Schema->new( location => $schema_filename_or_url ); eval { $xmlschema->validate( $doc ); }; on perl v5.12.3 - winXP LibXML - 1.70
Hi McPower, please provide a self-contained test for this under t/ using "use strict;" , "use warnings;" and Test::More. See: * http://search.cpan.org/perldoc?Test::Tutorial Regards, -- Shlomi Fish On Sun Apr 10 09:54:29 2011, mc-power@justmail.de wrote: Show quoted text
> Hello, > the validate Routine has a Problem with/minOccurs="0" //maxOccurs="0"/. > The Error Message is wrong. > The correct Message is /Schemas validity error : Element '{.....}b': > This element is not expected./ > > It is only a Pointer Error in the library? i+1 ? > > > XML: > > <a> > <b>testA</b> > <c>testB</c> > </a> > > > XSD: > > <xs:complexType name="a"> > <xs:element name="b" type="myString100" minOccurs="0" > maxOccurs="0"> > </xs:element> > <xs:element name="c" type="mxString100"> > </xs:element> > </xs:complexType> > > > ERROR: > > in.xml:0: Schemas validity error : Element '{.....}c': This element is > not expected. > > > > > $xml_filename_or_url = "in.xml"; > $schema_filename_or_url = "schema.xsd"; > use XML::LibXML; > $doc = XML::LibXML->new->parse_file($xml_filename_or_url); > $xmlschema = XML::LibXML::Schema->new( location => > $schema_filename_or_url ); > eval { $xmlschema->validate( $doc ); }; > > on perl v5.12.3 - winXP > LibXML - 1.70
Rejecting due to lack of responsiveness from the original reporter. Please reply if you can supply more information.