Hi Michael, Thanks for the reply. Yes, you are right . I need the available information from the given DTD. For any element I want its all possible children. Thats why I tried to get DTDGrammar.(Is there any other suitable way??) Now as suggested by you, I have parsed the diven DTD but it returns me Grammar. How can I get DTDGrammar?
Utsav > Hi Ustav, > > It seems to me that you're trying to parse a DTD, and obtain it's > representation as a DTDGrammar. You should take a look at the > XMLGrammarPreparser > (http://xml.apache.org/xerces2-j/faq-grammars.html#faq-3). > > The approach you're taking doesn't do what you probably expected. Creating > an instance of DTDGrammar doesn't cause your DTD to be parsed. > DTDGrammar is a container, not a parser. The object won't contain any > declarations, after instantiating it. It's normally populated from a > stream generated by the XML scanner. So unless you were planning to > populate it > yourself by some other means, your best bet is to use the > XMLGrammarPreparser. > > Hope that helps. > > On Thu, 12 Jun 2003, Utsav Boobna wrote: > >> >> Hi >> In my Java program, I was trying to initiate a DTDGrammar.Below is >> the part of my code ....... I cant understand why the grammar doesnt >> initiate, probably I am missing something. >> Please help. >> >> SymbolTable sym = new SymbolTable(2039); >> XMLDTDDescription desc = new XMLDTDDescription >> (null,"book.dtd",null,"book.dtd","book"); >> DTDGrammar grammar = new DTDGrammar (sym,desc); >> >> Problem might be in specifying the system ID of the DTD(??). >> all the files are in same directory. >> >> Thanks, >> Utsav >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > -------------------- > Michael Glavassevich > [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
