xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heeg, Michael" <H...@fev.de>
Subject AW: Strange problem with pattern (Xerces 2.5.0 crashes)
Date Thu, 15 Apr 2004 08:43:45 GMT
Hi Garth,

attached you can find three files:
1) schema (schema.xsd)
2) one file which works (works.fih)
3) one file which leads to a crash (crashes.fih)

Thanks in advance,
Michael


> -----Urspr√ľngliche Nachricht-----
> Von: Gareth Reakes [mailto:gareth@parthenoncomputing.com]
> Gesendet: Donnerstag, 15. April 2004 10:37
> An: 'xerces-c-dev@xml.apache.org'
> Betreff: Re: Strange problem with pattern (Xerces 2.5.0 crashes)
> 
> 
> Hi,
> 	can you post a working schema and instance file 
> (preferably small)
> and I will take a look.
> 
> Cheers,
> 
> Garth
> 
> 
> On Thu, 15 Apr 2004, Heeg, Michael wrote:
> 
> > Hi,
> >
> > I am using Xerces-C 2.5.0 in my MS Visual C++ application. 
> When validating
> > XML files against a specified schema, the parser sometimes 
> crashes with an
> > "unexpected exception". I found out that the reason for the 
> crashes is the
> > following restriction of the schema (see "Body" element):
> >
> > <xsd:complexType name="InputFileType">
> > 	<xsd:sequence>
> > 		<xsd:element name="Head" type="HeadType"/>
> > 		<xsd:element name="Body">
> > 			<xsd:simpleType>
> > 				<xsd:restriction base="xsd:string">
> > 					<xsd:pattern
> > 
> value="(\n*[0-9]*,[0-9]*,(\-*[0-9]*\.*[0-9]*,)*\-*[0-9]+\.*[0-
> 9]*;\n*)*"/>
> > 				</xsd:restriction>
> > 			</xsd:simpleType>
> > 		</xsd:element>
> > 	</xsd:sequence>
> > </xsd:complexType>
> >
> > The restriction is defined to validate <Body> tags like the 
> following:
> >
> > <Body>
> > 0,10,0.199,10.199,0.008;
> > 1,20,0.389,20.389,0.059;
> > 2,30,0.565,30.565,0.180;
> > 3,40,0.717,40.717,0.369;
> > 4,50,0.841,50.841,0.596;
> > 5,60,0.932,60.932,0.810;
> > ....
> > </Body>
> >
> > The strange thing is: when the <Body> tag contains a large 
> amount of data,
> > the validation of the restriction leads to the unexpected 
> exception. But:
> > with a small amount of data, everything works fine. (Also: 
> when I delete the
> > restriction from the schema, everything works fine.)
> >
> > For me this looks like a Xerces bug?! Am I wrong? Any suggestions or
> > comments?
> >
> > Best regards,
> > Michael
> >
> >
> > P.S.: I know that the way we use this <Body> tag is not the 
> best way to
> > handle csv-like data, but I had to do this because of an 
> existing file
> > format.
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> >
> 
> -- 
> Gareth Reakes, Managing Director      Parthenon Computing
> +44-1865-811184                  http://www.parthcomp.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
> 


Mime
View raw message