Dear Rahul, > I dont know why I didnt recieved any suggestion, > possibly the question was out of the subject of this > mailing group. Let me make it much more to the point, > which classes defined by Xerces can I use to scan the > DTD, and get the relevant information from it. I dont > want to start from basic and read it as a simple file. > > As I am a bit new to this field, please try to give > slightly detailed suggestion (OR if possible, with a > sample of the program using that class)
One way to do it with the event driven way. You can use both SAX and XNI for this, where SAX is more standard and XNI is (currently) Xerces specific, but more powerful. But both work in about the same way. For the relevant XNI interface, see http://xml.apache.org/xerces2-j/javadocs/xni/org/apache/xerces/xni/XMLDT DHandler.html For the relevant SAX interface, see http://xml.apache.org/xerces2-j/javadocs/api/org/xml/sax/ext/DeclHandler .html However, it is easier to look at some samples, in a recent Xerces distribution you can look in either xercesDir/samples/xni/DocumentTracer.java or xercesDir/samples/sax/DocumentTracer.java which both implement these interfaces in order to print DTD information on the console (which is sort of a 'scan'). There you can see how you can implement the interface and then set your handler on a parser. Please note that these classes implement a lot of different handlers, so they deal not just with the DTDs. Kind regards, --Sander. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
