You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Martin Fuhrer <ma...@mgm-edv.de> on 2000/07/17 17:54:04 UTC

setValidating method

I have been attempting to use the setValidating() method in the XMLParser class to turn validation on, but after testing with the following code, it does not appear to work:

DOMParser parser = new DOMParser();
parser.setValidating(true);
boolean validating = parser.getFeature("http://xml.org/sax/features/validation");
System.out.println("Validation is " + validating);        // displays: "Validation is false"

So what, in fact, is setValidating() supposed to do?  (the Xerces API gives the rather brief explanation "Tell the parser that we are validating", but the example above seems to contradict this.)

Many thanks,
Martin


Re: setValidating method

Posted by Martin Fuhrer <ma...@mgm-edv.de>.
I installed Xerces-J-tools 1.1.2, which contains the Xerces 1.0.1 library (xerces-1.0.1.jar, which is in my classpath).  The reference to the setValidating() method is found in the Xerces API at http://xml.apache.org/apiDocs/org/apache/xerces/framework/XMLParser.html

But you are correct-- I can't find the method in my sources either.  Maybe it has been quietly deprecated?

Martin
  ----- Original Message ----- 
  From: Eric Ye 
  To: xerces-j-dev@xml.apache.org 
  Sent: Monday, July 17, 2000 8:54 PM
  Subject: Re: setValidating method


  Which version of Xerces-J are we talking about here?  It's no longer in the latest source.
  _____


  Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

    ----- Original Message ----- 
    From: Martin Fuhrer 
    To: xerces-j-dev@xml.apache.org 
    Sent: Monday, July 17, 2000 8:54 AM
    Subject: setValidating method


    I have been attempting to use the setValidating() method in the XMLParser class to turn validation on, but after testing with the following code, it does not appear to work:

    DOMParser parser = new DOMParser();
    parser.setValidating(true);
    boolean validating = parser.getFeature("http://xml.org/sax/features/validation");
    System.out.println("Validation is " + validating);        // displays: "Validation is false"

    So what, in fact, is setValidating() supposed to do?  (the Xerces API gives the rather brief explanation "Tell the parser that we are validating", but the example above seems to contradict this.)

    Many thanks,
    Martin


Re: setValidating method

Posted by Eric Ye <er...@locus.apache.org>.
Which version of Xerces-J are we talking about here?  It's no longer in the latest source.
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

  ----- Original Message ----- 
  From: Martin Fuhrer 
  To: xerces-j-dev@xml.apache.org 
  Sent: Monday, July 17, 2000 8:54 AM
  Subject: setValidating method


  I have been attempting to use the setValidating() method in the XMLParser class to turn validation on, but after testing with the following code, it does not appear to work:

  DOMParser parser = new DOMParser();
  parser.setValidating(true);
  boolean validating = parser.getFeature("http://xml.org/sax/features/validation");
  System.out.println("Validation is " + validating);        // displays: "Validation is false"

  So what, in fact, is setValidating() supposed to do?  (the Xerces API gives the rather brief explanation "Tell the parser that we are validating", but the example above seems to contradict this.)

  Many thanks,
  Martin