[jdom-interest] Reading files without a DTD

Dmitriy Viner dxv7027 at yahoo.com
Tue Jun 20 09:18:56 PDT 2006


I'm trying to traverse a well-formed files without a dtd.  I'm not validating any files.  I have it explicitly turned off.  Files between 10k and 10M go through without any problems.  However once the file becomes 20M I'm getting this exception from exactly the same code that reads smaller files without any problems:
   
   parser = new SAXBuilder();
   document = parser.build("file.xml"); 
   
  String:org.jdom.input.JDOMParseException: Error on line 1 of document file:///C:/samples/file.xml: cvc-elt.1: Cannot find the declaration of element 'astg'.
Message:Error on line 1 of document file:///C:/samples/file.xml: cvc-elt.1: Cannot find the declaration of element 'astg'.
Java Result: 1
   
  File file.xml is just well formed file with a root tag astg and structure that looks exactly like this:
   
  <astg>
            <element1/> <element2/> ......
  </astg>
  
 
  If I add a DOCTYPE statement and a dummy dtd the file goes right through.  
   
  <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE astg SYSTEM "vlr.dtd" [
]>
  <astg>
            <element1/> <element2/> ......
  </astg>
   
  astg.dtd
  <?aptxml version="1.0" encoding="utf-8"?>
<!ELEMENT astg (#PCDATA)>
   
  Do you guys have any idea what is possible cause of the exception?
   
  Regards,
  DV
   

 			
---------------------------------
Sneak preview the  all-new Yahoo.com. It's not radically different. Just radically better. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20060620/781955de/attachment.htm


More information about the jdom-interest mailing list