Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Reading files without a DTD

Reading files without a DTD

2006-06-20       - By Dmitriy Viner

 Back
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 (See http://UTF-8.ora-code.com)"?>
<!DOCTYPE astg SYSTEM "vlr.dtd" [
]>
 <astg>
           <element1/> <element2/> ......
 </astg>
 
 astg.dtd
 <?aptxml version="1.0" encoding="utf-8 (See http://utf-8.ora-code.com)"?>
<!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.
<div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I'm trying to traverse a
well-formed files without a dtd.&nbsp;&nbsp;I'm not validating any files.&nbsp;
I have it explicitly turned off.&nbsp; Files&nbsp;between 10k and 10M go
through without any problems.&nbsp; However once the file becomes 20M I'm
getting this exception&nbsp;from exactly the same code that&nbsp;reads smaller
files without any problems:<?xml:namespace prefix = o ns = "urn:schemas
-microsoft-com:office:office" /><o:p></o:p></SPAN></div>  <div><SPAN style="FONT
-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div>  <div><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;parser = new SAXBuilder();<o
:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
&nbsp;document = parser.build("file.xml"); <o:p></o:p></SPAN></div>  <div><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div>  
<div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY:
Arial">String:org.jdom.input.JDOMParseException: Error on line 1 of document
<A href="file:///C:/samples/file.xml">file:///C:/samples/file.xml</A>: cvc-elt.1
: Cannot find the declaration of element 'astg'.<BR>Message:Error on line 1 of
document <A href="file:///C:/samples/file.xml">file:///C:/samples/file.xml</A>:
cvc-elt.1: Cannot find the declaration of element 'astg'.<BR>Java Result: 1<o:p
></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
&nbsp;<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY:
Arial">File file.xml is just well formed file with a root tag astg and
structure that looks exactly like this:</SPAN></div>  <div><SPAN style="FONT
-SIZE: 10pt; FONT-FAMILY: Arial"><o:p></o:p></SPAN>&nbsp;</div>  <div><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&lt;astg&gt;<o:p></o:p></SPAN></div
>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;element1/&gt;
&lt;element2/&gt; ......<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE:
10pt; FONT-FAMILY: Arial">&lt;/astg&gt;<o:p></o:p></SPAN></div>  <div><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><BR>&nbsp;<o:p></o:p></SPAN></div>
<div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">If I add a DOCTYPE
statement and a dummy dtd the file goes right through.&nbsp; <o:p></o:p></SPAN>
</div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p>
</SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&lt;?xml
version="1.0" encoding="UTF-8 (See http://UTF-8.ora-code.com)"?&gt;<BR>&lt;!DOCTYPE astg SYSTEM "vlr.dtd" [<BR>
]&gt;<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY:
Arial">&lt;astg&gt;<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE: 10pt;
FONT-FAMILY: Arial">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt
;element1/&gt; &lt;element2/&gt; ......<o:p></o:p></SPAN></div>  <div><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY:
Arial">&lt;/astg&gt;<o:p></o:p></SPAN></div>  <div><SPAN style="FONT-SIZE:
10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></div>  <div><SPAN style=
"FONT-SIZE: 10pt; FONT-FAMILY: Arial">astg.dtd<o:p></o:p></SPAN></div>  <div>
<SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&lt;?aptxml version="1.0"
encoding="utf-8 (See http://utf-8.ora-code.com)"?&gt;<BR>&lt;!ELEMENT astg (#PCDATA)&gt;<o:p></o:p></SPAN></div
>  <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><STRONG><FONT face=
"Times New Roman" size=3>&nbsp;</FONT></STRONG></o:p></div>  <div class
=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><FONT face="Times New Roman" size
=3>Do you guys have any idea what is possible cause of the exception?</FONT><
/STRONG></div>  <div class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><STRONG>
<FONT face="Times New Roman" size=3>&nbsp;</FONT></STRONG></o:p></div>  <div
class=MsoNormal style="MARGIN: 0in 0in 0pt"><STRONG><FONT face="Times New Roman
" size=3>Regards,</FONT></STRONG></div>  <div class=MsoNormal
style="MARGIN: 0in 0in 0pt"><STRONG><FONT size=3><FONT face="Times New Roman"
>DV<o:p></o:p></FONT></FONT></STRONG></div>  <div>&nbsp;</div><p>&#32;
 
    <hr size=1>Sneak preview the <a href="http://us.rd.yahoo.com/evt=40762/*http:
//www.yahoo.com/preview"> all-new Yahoo.com</a>. It's not radically different.
Just radically better.

__ ____ ____ ____ ____ ____ ____ ____ ____ ____
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.