← Prev in month ← Prev in thread

I am going crazy!!

From
Rajesh AVRS <>
To
Date
2002-01-22T04:13:35Z
ID
<14e801c1a2fb$2b4c0d60$9f1fc80a@ITPEXE107981>
Thread
I am going crazy!!
Hi All,

I have written a Java application which simply parses the given XML file.
But now I want to turn the validation ON, so that it will validate the XML
document against the specified DTD within the DOCTYPE declaration.  Here is
my code:

    DOMParser parser = new DOMParser();
    try
    {
     parser.setFeature("http://xml.org/sax/features/validation", true);
      if(debugSwitch)
     {
      String[] temp = parser.getFeaturesRecognized();

      for(int i=0; i<temp.length; i++)
       System.out.println(temp[i]);
     }

     parser.parse(xmlFile);
     doc = parser.getDocument();

But even when I define an element which is not specified in the DTD it is
parsing the XML file without any errors.  I am going crazy.  Please help me
out.
← Prev in month ← Prev in thread