E
Ewan B
Hi,
I'm using Xerces to parse XML files using SAX2, and am wondering if
there is any information as to what exceptions are being thrown when
certain validation errors occur.
Taking a simple example schema
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ...>
<xs:element name="root">
<xs:complexType>
.......
.......
<xs:attribute name="myAttribute" type="xs:double"/>
</xs:complexType>
</xs:element>
</xs:schema>
and instance document:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
myAttribute="0.9i">
.......
</root>
Because myAttribute is not of type double, you'd expect the parser to
report an error, but then continue after reporting the error.
When parsing the document using the given example program
SAX2Count.exe, the error is reported, but then the parser bails out,
and an exception is caught using catch( ... ).
1. Does anyone know what type of exception is being thrown ?
2. Is there any way to allow the parser to continue after it finds
such an error?
thanks,
Ewan
I'm using Xerces to parse XML files using SAX2, and am wondering if
there is any information as to what exceptions are being thrown when
certain validation errors occur.
Taking a simple example schema
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ...>
<xs:element name="root">
<xs:complexType>
.......
.......
<xs:attribute name="myAttribute" type="xs:double"/>
</xs:complexType>
</xs:element>
</xs:schema>
and instance document:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
myAttribute="0.9i">
.......
</root>
Because myAttribute is not of type double, you'd expect the parser to
report an error, but then continue after reporting the error.
When parsing the document using the given example program
SAX2Count.exe, the error is reported, but then the parser bails out,
and an exception is caught using catch( ... ).
1. Does anyone know what type of exception is being thrown ?
2. Is there any way to allow the parser to continue after it finds
such an error?
thanks,
Ewan