Exceptions when validation errors occur when parsing with Xerces C++

Discussion in 'XML' started by Ewan B, Sep 26, 2003.

  1. Ewan B

    Ewan B Guest

    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
     
    Ewan B, Sep 26, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel Dias Moura
    Replies:
    4
    Views:
    461
    Hans Kesting
    May 6, 2004
  2. Stefan Siegl
    Replies:
    2
    Views:
    744
    David Zimmerman
    Jul 17, 2003
  3. Mick
    Replies:
    0
    Views:
    436
  4. Afanasiy
    Replies:
    3
    Views:
    297
    Peter Hansen
    Nov 4, 2003
  5. Thomas
    Replies:
    2
    Views:
    413
    Thomas
    Sep 27, 2007
Loading...

Share This Page