how to stop Xerces

Discussion in 'XML' started by Mhaxx, Sep 29, 2004.

  1. Mhaxx

    Mhaxx Guest

    How can I stop Xerces Java 2.6.2 execution? If there is a validation
    error I want to stop parsing, but now it goes on.. :-(

    Mhaxx
     
    Mhaxx, Sep 29, 2004
    #1
    1. Advertising

  2. Mhaxx wrote:
    > How can I stop Xerces Java 2.6.2 execution? If there is a validation
    > error I want to stop parsing, but now it goes on.. :-(


    That's normal behavior. Only fatal errors (violating wellformedness)
    make the parser stop.

    You may ry
    System.exit()
    in your ErrorHandler's error method.
    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
     
    Johannes Koch, Sep 29, 2004
    #2
    1. Advertising

  3. "Johannes Koch" <> wrote in message
    news:...
    > Mhaxx wrote:
    > > How can I stop Xerces Java 2.6.2 execution? If there is a validation
    > > error I want to stop parsing, but now it goes on.. :-(

    >
    > That's normal behavior. Only fatal errors (violating wellformedness)
    > make the parser stop.
    >
    > You may ry
    > System.exit()
    > in your ErrorHandler's error method.


    Would throwing an exception in the error method stop the parser? (without
    necessarily stopping the calling program)

    /kmc
     
    Keith M. Corbett, Sep 29, 2004
    #3
  4. Keith M. Corbett wrote:
    > Would throwing an exception in the error method stop the parser?


    I don't think so.
    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
     
    Johannes Koch, Sep 29, 2004
    #4
  5. Johannes Koch wrote:

    > Keith M. Corbett wrote:
    >
    >> Would throwing an exception in the error method stop the parser?

    >
    >
    > I don't think so.


    My Java SDK documention for 1.4 says:

    public void parse(InputSource input)
    throws IOException,
    SAXException
    Parse an XML document.


    During the parse, the XMLReader will provide information about the XML
    document through the registered event handlers.

    This method is synchronous: it will not return until parsing has ended.
    If a client application wants to terminate parsing early, it should
    throw an exception.




    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Sep 29, 2004
    #5
  6. Martin Honnen wrote:
    > public void parse(InputSource input)
    > throws IOException,
    > SAXException
    > Parse an XML document.
    >
    >
    > During the parse, the XMLReader will provide information about the XML
    > document through the registered event handlers.
    >
    > This method is synchronous: it will not return until parsing has ended.
    > If a client application wants to terminate parsing early, it should
    > throw an exception.


    Ah, I should RTFM :)
    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
     
    Johannes Koch, Sep 29, 2004
    #6
    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. Matt Theule

    Stop Debugging doesn't stop in ASP.NET

    Matt Theule, Jul 23, 2003, in forum: ASP .Net
    Replies:
    7
    Views:
    753
    Matt Theule
    Jul 24, 2003
  2. Son KwonNam
    Replies:
    11
    Views:
    2,622
    mr_organic
    Apr 9, 2004
  3. Will
    Replies:
    1
    Views:
    15,334
    Thomas Weidenfeller
    Nov 2, 2004
  4. cvissy
    Replies:
    0
    Views:
    623
    cvissy
    Nov 16, 2004
  5. Angus
    Replies:
    5
    Views:
    465
    Ben Bacarisse
    Jul 18, 2010
Loading...

Share This Page